PowerTools MultiRow for Windows Forms 8.0J
HorizontalSpace プロパティ
使用例 

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

プロパティ値

隣接項目との水平方向の間隔を表すSystem.Int32値。既定値は0です。
例外
例外解説
System.ArgumentOutOfRangeException指定された値が0未満です。
使用例
次のサンプルコードは、RadioGroupCellの持ついくつかの重要なプロパティを示します。Column1では、ColumnCountを3に設定することで、6個のラジオボタンを3列に配置します。各ラジオボタンは左から右に並べ、隣接する2つの列の間には20ピクセル以上の間隔を空けます。Column2でも、6個のラジオボタンを3列に配置します。ラジオボタンを並べる方向は上から下にし、隣接する2つの行の間隔を20ピクセル以上にします。テキスト全体を表示できないため、EllipsisStringが表示されます。このサンプルコードは、RadioGroupCellに示されている詳細なコード例の一部を抜粋したものです。
private void Form1_Load(object sender, EventArgs e)
{
    RadioGroupCell radioGroupCell1 = new RadioGroupCell();
    radioGroupCell1.Size = new Size(150, 60);

    radioGroupCell1.Items.AddRange(new string[] { "1", "2", "3", "4", "5", "6" });
    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;

    RadioGroupCell radioGroupCell2 = new RadioGroupCell();
    radioGroupCell2.Size = new Size(150, 60);
    radioGroupCell2.Items.AddRange(new string[] { "11111", "22222", "33333", "44444", "55555", "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 = MultiRowEllipsisMode.EllipsisEnd;
    radioGroupCell2.EllipsisString = "...";

    Template template1 = Template.CreateGridTemplate(new Cell[] { radioGroupCell1, radioGroupCell2 });

    gcMultiRow1.Template = template1;
    gcMultiRow1.RowCount = 3;
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    Dim radioGroupCell1 As New RadioGroupCell()
    radioGroupCell1.Size = New Size(150, 60)

    radioGroupCell1.Items.AddRange(New String() {"1", "2", "3", "4", "5", "6"})
    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 RadioGroupCell()
    radioGroupCell2.Size = New Size(150, 60)
    radioGroupCell2.Items.AddRange(New String() {"11111", "22222", "33333", "44444", "55555", "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 = MultiRowEllipsisMode.EllipsisEnd
    radioGroupCell2.EllipsisString = "..."

    Dim template1 As Template = Template.CreateGridTemplate(New Cell() {radioGroupCell1, radioGroupCell2})

    gcMultiRow1.Template = template1
    gcMultiRow1.RowCount = 3
End Sub
参照

RadioGroupCell クラス
RadioGroupCell メンバ

 

 


© 2008-2015 GrapeCity inc. All rights reserved.