日付時刻や日付コントロールのドロップダウンカレンダーのヘッダ部分を和暦表示にしたい
対象製品
InputMan for Windows Forms 10.0J
詳細
日付時刻コントロールや日付コントロールのドロップダウンカレンダーでは、ヘッダの表示を和暦にすることが可能です。和暦表示の方法はカレンダーの種類が「月-日カレンダー形式」か「年-月カレンダー形式」かによって異なります。
月-日カレンダー形式の場合
カレンダー形式が「月-日」(DropDownCalendarクラスのCalendarTypeプロパティが CalendarType.MonthDay の場合)にはHeaderFormatプロパティに書式を設定し、UseHeaderFormatプロパティによってその書式を使用するかどうかを決定します。
[Visual Basic]
[C#]
年-月カレンダー形式の場合
カレンダー形式が「年-月」(DropDownCalendarクラスのCalendarTypeプロパティがCalendarType.YearMonthの場合)には YearMonthFormatプロパティに書式を設定することで、和暦表示とすることが可能です。
[Visual Basic]
[C#]
月-日カレンダー形式の場合
カレンダー形式が「月-日」(DropDownCalendarクラスのCalendarTypeプロパティが CalendarType.MonthDay の場合)にはHeaderFormatプロパティに書式を設定し、UseHeaderFormatプロパティによってその書式を使用するかどうかを決定します。
[Visual Basic]
' 月-日カレンダー形式の場合 GcDateTime1.DropDownCalendar.CalendarType = GrapeCity.Win.Editors.CalendarType.MonthDay ' ヘッダの書式を設定して使用します。 GcDateTime1.DropDownCalendar.HeaderFormat = "ggg e年" GcDateTime1.DropDownCalendar.UseHeaderFormat = True
[C#]
// 月-日カレンダー形式の場合 GcDateTime1.DropDownCalendar.CalendarType = GrapeCity.Win.Editors.CalendarType.MonthDay; // ヘッダの書式を設定して使用します。 GcDateTime1.DropDownCalendar.HeaderFormat = "ggg e年"; GcDateTime1.DropDownCalendar.UseHeaderFormat = true;
年-月カレンダー形式の場合
カレンダー形式が「年-月」(DropDownCalendarクラスのCalendarTypeプロパティがCalendarType.YearMonthの場合)には YearMonthFormatプロパティに書式を設定することで、和暦表示とすることが可能です。
[Visual Basic]
' 年-月カレンダー形式の場合 GcDateTime1.DropDownCalendar.CalendarType = GrapeCity.Win.Editors.CalendarType.YearMonth ' YearMonthFormatプロパティに書式を設定します。 GcDateTime1.DropDownCalendar.YearMonthFormat = New GrapeCity.Win.Editors.YearMonthFormat("ggg e年", "MMMM")
[C#]
// 年-月カレンダー形式の場合 GcDateTime1.DropDownCalendar.CalendarType = GrapeCity.Win.Editors.CalendarType.YearMonth; // YearMonthFormatプロパティに書式を設定します。 GcDateTime1.DropDownCalendar.YearMonthFormat = new GrapeCity.Win.Editors.YearMonthFormat("ggg e年", "MMMM");