PowerTools CalendarGrid for Windows Forms 1.0J
GDI+互換モード

CalendarGridのセルは、GDIとGDI+の両方による文字列描画をサポートしています。既定の設定では、GDIが使用されます。CellStyle.UseCompatibleTextRenderingプロパティをTrueに設定すると、GDI+が使用されます。このプロパティの動作は、.NET Framework 2.0以降のLabelコントロールやButtonコントロールと同じです。
ここでは、CellStyle.UseCompatibleTextRenderingプロパティの値がTrueの状態を「GDI+互換モード」として解説します。
セル型がスタイルのGDI+互換モードをサポートしているかどうかは、各セル型の「スタイル」を参照してください。

注意
GDIとGDI+の差異により、GDI+互換モードを有効にするといくつかの制限事項が生じます。詳細はこのページの「制限事項」を参照してください。


GDI+互換モードを有効にする

GDI+互換モードを有効にするには、CalendarCellStyle.UseCompatibleTextRenderingプロパティをTrueに設定します。

Imports GrapeCity.Win.CalendarGrid

Dim today As DateTime = DateTime.Today
GcCalendarGrid1.Content(today).Rows(1).Cells(0).Value = "GDI+ 互換モード"
GcCalendarGrid1.Content(today).Rows(1).Cells(0).CellStyle.UseCompatibleTextRendering = CalendarGridTriState.True
gcCalendarGrid1.ScrollIntoView(today)
using GrapeCity.Win.CalendarGrid;

var today = DateTime.Today;
gcCalendarGrid1.Content[today].Rows[1].Cells[0].Value = "GDI+ 互換モード";
gcCalendarGrid1.Content[today].Rows[1].Cells[0].CellStyle.UseCompatibleTextRendering = CalendarGridTriState.True;
gcCalendarGrid1.ScrollIntoView(today);


テキストの均等割付

GDI+ 互換モードが有効のとき、テキストの均等割付を使用できます。
均等割付の左右のスペースを指定するには、パディングか均等配分の一方または両方を併用できます。Excelと異なり、インデントは均等割付には適用されません。

Imports GrapeCity.Win.CalendarGrid

Dim today As DateTime = DateTime.Today
GcCalendarGrid1.Content(today).Rows(1).Cells(0).CellStyle.TextAdjustment = CalendarTextAdjustment.Distribute
GcCalendarGrid1.Content(today).Rows(1).Cells(0).CellStyle.UseCompatibleTextRendering = CalendarGridTriState.True
GcCalendarGrid1.Content(today).Rows(1).Cells(0).Value = "北海道"
GcCalendarGrid1.ScrollIntoView(today)
using GrapeCity.Win.CalendarGrid;

var today = DateTime.Today;
gcCalendarGrid1.Content[today].Rows[1].Cells[0].CellStyle.TextAdjustment = CalendarTextAdjustment.Distribute;
gcCalendarGrid1.Content[today].Rows[1].Cells[0].CellStyle.UseCompatibleTextRendering = CalendarGridTriState.True;
gcCalendarGrid1.Content[today].Rows[1].Cells[0].Value = "北海道";
gcCalendarGrid1.ScrollIntoView(today);


テキストの回転

GDI+互換モードが有効のとき、テキストの回転を使用できます。テキストの角度はCalendarCellStyle.TextAngleプロパティで設定します。


テキストの縦書き

GDI+互換モードが有効のとき、テキストの縦書きを使用できます。縦書の設定はCalendarCellStyle.TextVerticalプロパティを使用します。
縦書きでは、シフトJISの半角英数や半角カタカナに相当する文字は回転して横書きされます。これらの文字を縦書きする場合は、対応する全角文字を使用してください。


制限事項


参照

 

 


© 2014 GrapeCity inc. All rights reserved.