カレンダーのヘッダ部分を和暦表示にしたい

文書番号 : 30770     文書種別 : 使用方法     最終更新日 : 2011/04/29
文書を印刷する
対象製品
PlusPak for Windows Forms 6.0J
詳細
和暦対応拡張カレンダーコントロールでは、ヘッダの表示を和暦にすることが可能です。和暦表示の方法はカレンダーの種類が「月-日カレンダー形式」か「年-月カレンダー形式」かによって異なります。

【月-日カレンダー形式の場合】
カレンダー形式が「月-日」(CalendarTypeプロパティが MonthDayの場合)には HeaderFormatプロパティに書式を設定し、UseHeaderFormatプロパティによってその書式を使用するかどうかを設定します。

[Visual Basic]
  ' 月-日カレンダー形式の場合
  GcCalendar1.CalendarType = GrapeCity.Win.Calendar.CalendarType.MonthDay
  ' ヘッダの書式を設定して使用します。
  GcCalendar1.HeaderFormat = "ggg e年"
  GcCalendar1.UseHeaderFormat = True

[C#]
  // 月-日カレンダー形式の場合
  gcCalendar1.CalendarType = GrapeCity.Win.Calendar.CalendarType.MonthDay;
  // ヘッダの書式を設定して使用します。
  gcCalendar1.HeaderFormat = "ggg e年";
  gcCalendar1.UseHeaderFormat = true;


【年-月カレンダー形式の場合】
カレンダー形式が「年-月」(CalendarTypeプロパティが YearMonthの場合)には YearMonthFormatプロパティに書式を設定することで、和暦表示にすることが可能です。

[Visual Basic]
  ' 年-月カレンダー形式の場合
  GcCalendar1.CalendarType = GrapeCity.Win.Calendar.CalendarType.YearMonth
  ' YearMonthFormatプロパティに書式を設定します。
  GcCalendar1.YearMonthFormat = New GrapeCity.Win.Calendar.YearMonthFormat("ggg e年", "MMMM")

[C#]
  // 年-月カレンダー形式の場合
  gcCalendar1.CalendarType = GrapeCity.Win.Calendar.CalendarType.YearMonth;
  // YearMonthFormatプロパティに書式を設定します。
  gcCalendar1.YearMonthFormat = new GrapeCity.Win.Calendar.YearMonthFormat("ggg e年", "MMMM");