PowerTools CalendarGrid for Windows Forms 1.0J
HorizontalSpace プロパティ
使用例 

項目間の水平方向の間隔を取得または設定します。
構文
Public Property HorizontalSpace As Integer
public int HorizontalSpace {get; set;}

プロパティ値

隣接する項目間の水平方向の間隔を表す System.Int32 値。既定値は 0 です。
例外
例外解説
System.ArgumentOutOfRangeException指定された値が 0 未満です。
使用例
次のサンプルコードは、CalendarRadioGroupCellType のいくつかの重要なプロパティを示します。最初のラジオグループでは、ColumnCount を 3 に設定して、6 個のラジオボタン項目を 3 列に配置しています。項目は左から右に並びます。20 ピクセルの列間隔を空けます。2 番目のラジオグループでは、6 個のラジオボタン項目を 3 列に配置しています。項目は上から下に並びます。20 ピクセルの行間隔を空けます。テキストは表示できないため、EllipsisString は表示されません。このサンプルコードは、CalendarRadioGroupCellType クラスに示されている詳細なコード例の一部を抜粋したものです。
private void Form1_Load(object sender, EventArgs e)
{
    CalendarRadioGroupCellType radioGroupCell1 = new CalendarRadioGroupCellType();
    for (int i = 1; i < 7; i++)
    {
        radioGroupCell1.Items.Add(i.ToString());
    }
    radioGroupCell1.CheckAlign = ContentAlignment.MiddleLeft;
    //6 radio will be lay out to 3 columns.
    radioGroupCell1.ColumnCount = 3;
    //The radio button will range from left to right.
    radioGroupCell1.FlowDirection = Orientation.Horizontal;
    //Between every 2 columns, 20 pixels space exists at least.
    radioGroupCell1.HorizontalSpace = 20;
    radioGroupCell1.FlatStyle = FlatStyle.Popup;

    CalendarRadioGroupCellType radioGroupCell2 = new CalendarRadioGroupCellType();
    radioGroupCell2.Items.Add("11111");
    radioGroupCell2.Items.Add("22222");
    radioGroupCell2.Items.Add("33333");
    radioGroupCell2.Items.Add("44444");
    radioGroupCell2.Items.Add("55555");
    radioGroupCell2.Items.Add("66666");
    radioGroupCell2.CheckAlign = ContentAlignment.MiddleLeft;
    //6 radio will be lay out to 3 columns.
    radioGroupCell2.ColumnCount = 3;
    //The radio button will range from top to bottom.
    radioGroupCell2.FlowDirection = Orientation.Vertical;
    //Between every 2 lines, 20 pixels space exists at least.
    radioGroupCell2.VerticalSpace = 20;
    //
    radioGroupCell2.Ellipsis = CalendarGridEllipsisMode.EllipsisEnd;
    radioGroupCell2.EllipsisString = "...";

    CalendarTemplate template1 = CalendarTemplate.CreateDefaultTemplate();
    template1.Content.Columns[0].Width = 150;
    template1.Content.Rows[1].Height = 60;
    template1.Content.Rows[2].Height = 60;
    template1.Content[1, 0].CellType = radioGroupCell1;
    template1.Content[2, 0].CellType = radioGroupCell2;
    gcCalendarGrid1.Template = template1;
}
Private Sub Form1_Load(sender As Object, e As EventArgs)
    Dim radioGroupCell1 As New CalendarRadioGroupCellType()
    For i As Integer = 1 To 6
        radioGroupCell1.Items.Add(i.ToString())
    Next
    radioGroupCell1.CheckAlign = ContentAlignment.MiddleLeft
    '6 radio will be lay out to 3 columns.
    radioGroupCell1.ColumnCount = 3
    'The radio button will range from left to right.
    radioGroupCell1.FlowDirection = Orientation.Horizontal
    'Between every 2 columns, 20 pixels space exists at least.
    radioGroupCell1.HorizontalSpace = 20
    radioGroupCell1.FlatStyle = FlatStyle.Popup

    Dim radioGroupCell2 As New CalendarRadioGroupCellType()
    radioGroupCell2.Items.Add("11111")
    radioGroupCell2.Items.Add("22222")
    radioGroupCell2.Items.Add("33333")
    radioGroupCell2.Items.Add("44444")
    radioGroupCell2.Items.Add("55555")
    radioGroupCell2.Items.Add("66666")
    radioGroupCell2.CheckAlign = ContentAlignment.MiddleLeft
    '6 radio will be lay out to 3 columns.
    radioGroupCell2.ColumnCount = 3
    'The radio button will range from top to bottom.
    radioGroupCell2.FlowDirection = Orientation.Vertical
    'Between every 2 lines, 20 pixels space exists at least.
    radioGroupCell2.VerticalSpace = 20
    '
    radioGroupCell2.Ellipsis = CalendarGridEllipsisMode.EllipsisEnd
    radioGroupCell2.EllipsisString = "..."

    Dim template1 As CalendarTemplate = CalendarTemplate.CreateDefaultTemplate()
    template1.Content.Columns(0).Width = 150
    template1.Content.Rows(1).Height = 60
    template1.Content.Rows(2).Height = 60
    template1.Content(1, 0).CellType = radioGroupCell1
    template1.Content(2, 0).CellType = radioGroupCell2
    gcCalendarGrid1.Template = template1
End Sub
参照

CalendarRadioGroupCellType クラス
CalendarRadioGroupCellType メンバ

 

 


© 2014 GrapeCity inc. All rights reserved.