I’m trying to make MonthCalendar in C++ CLI, and I found out how to do that, but when I run my application, there are four MonthCalendars. I want just one, and I don’t find any method to change that. Only what I can do is change size of calendar (smaller == less calendars).
What should I do to make "n" calendars in the size what I want?
Making instance of class:
this->kalendarz = gcnew System::Windows::Forms::MonthCalendar();
Initialize object:
this->kalendarz = gcnew System::Windows::Forms::MonthCalendar();
this->kalendarz->AnnuallyBoldedDates = gcnew cli::array < System::DateTime >(1)
{ System::DateTime(2004,7,4,0,0,0,0)};
this->kalendarz->CalendarDimensions = System::Drawing::Size(2,2);
this->kalendarz->Location = System::Drawing::Point(1,30);
this->kalendarz->MaxSelectionCount = 365;
this->kalendarz->MonthlyBoldedDates = gcnew cli::array < System::DateTime >(2)
{ System::DateTime(2004,7,4,0,0,0,0), System::DateTime(2004,7,4,0,0,0,0) };
this->kalendarz->Name = L"kalendarz";
this->kalendarz->ShowWeekNumbers = true;
this->kalendarz->Size = System::Drawing::Size(210,297);
this->kalendarz->TabIndex = 3;
===============
this->kalendarz->Size = System::Drawing::Size(410,297); == 4 calendars
this->kalendarz->Size = System::Drawing::Size(210,297); == 2 calendars
MonthCalendar.SetCalendarDimensionsshould get you what you want:It sets the number of rows and columns of months that should be displayed. Should be the same as this:
…which I just noticed you have set to
2,2in your example, so just change those to1,1.