0

作成しようとしてMonthCalendarC++ CLIますが、その方法を見つけましたが、アプリケーションを実行すると、4つありMonthCalendarsます。1つだけ欲しいのですが、それを変更する方法が見つかりません。私にできることは、カレンダーのサイズを変更することだけです(smaller == less calendars)。自分が望むサイズのカレンダーを作成するにはどうすればよい"n"ですか?

クラスのインスタンスの作成:

this->kalendarz = gcnew System::Windows::Forms::MonthCalendar();

オブジェクトを初期化します:

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
4

1 に答える 1

1

MonthCalendar.SetCalendarDimensionsあなたが望むものを手に入れるべきです:

this->kalendarz->SetCalendarDimensions(1, 1);

表示する月の行数と列数を設定します。これと同じである必要があります:

this->kalendarz->CalendarDimensions = System::Drawing::Size(1, 1);

...あなたが2,2あなたの例で設定したことに気づいたので、それらをに変更してください1,1

于 2012-08-17T12:28:21.777 に答える