PowerTools PlusPak for Windows Forms 8.0J
VerticalSpace プロパティ
使用例 

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

プロパティ値

項目間の垂直方向の間隔(ピクセル単位)。
例外
例外解説
System.ArgumentOutOfRangeException プロパティ値が0未満です。
使用例

次のサンプルコードは、GcCheckedGroupBox.LayoutSettingsプロパティ上でVerticalSpaceプロパティを設定して、GcCheckedGroupBox内のチェックボックス項目間の垂直方向の間隔を設定します。この例を実行するには、以下のコードをSystem.Windows.Forms.Formに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出す必要があります。

private void InitializeLayoutSettingsWithHorizontalLayout()
{
    GcCheckedGroupBox gcCheckedGroupBox = new GcCheckedGroupBox();

    // Set gcRadioGroupBox1's location.
    gcCheckedGroupBox.Location = new Point(10, 10);
    gcCheckedGroupBox.Text = "Table Layout Items";

    // Create some radio button items.
    CheckBoxItem[] items = new CheckBoxItem[] 
    {
        new CheckBoxItem("item1"),
        new CheckBoxItem("item2"),
        new CheckBoxItem("item3"),
        new CheckBoxItem("item4"),
        new CheckBoxItem("item5"),
    };

    // First add some items.
    gcCheckedGroupBox.Items.AddRange(items);

    // Customize the layout of items through LayoutSettings.
    gcCheckedGroupBox.LayoutSettings.LayoutMode = LayoutMode.Table;
    gcCheckedGroupBox.LayoutSettings.Orientation = Orientation.Horizontal;
    gcCheckedGroupBox.LayoutSettings.ColumnCount = 2;
    gcCheckedGroupBox.LayoutSettings.HorizontalSpace = 10;
    gcCheckedGroupBox.LayoutSettings.VerticalSpace = 10;

    // Add gcRadioGroupBo1 to the form.
    this.Controls.Add(gcCheckedGroupBox);
}
Private Sub InitializeLayoutSettingsWithHorizontalLayout()
    Dim gcCheckedGroupBox As New GcCheckedGroupBox()

    ' Set gcRadioGroupBox1's location.
    gcCheckedGroupBox.Location = New Point(10, 10)
    gcCheckedGroupBox.Text = "Table Layout Items"

    ' Create some radio button items.
    Dim items As CheckBoxItem() = New CheckBoxItem() {New CheckBoxItem("item1"), New CheckBoxItem("item2"), New CheckBoxItem("item3"), New CheckBoxItem("item4"), New CheckBoxItem("item5")}

    ' First add some items.
    gcCheckedGroupBox.Items.AddRange(items)

    ' Customize the layout of items through LayoutSettings.
    gcCheckedGroupBox.LayoutSettings.LayoutMode = LayoutMode.Table
    gcCheckedGroupBox.LayoutSettings.Orientation = Orientation.Horizontal
    gcCheckedGroupBox.LayoutSettings.ColumnCount = 2
    gcCheckedGroupBox.LayoutSettings.HorizontalSpace = 10
    gcCheckedGroupBox.LayoutSettings.VerticalSpace = 10

    ' Add gcRadioGroupBo1 to the form.
    Me.Controls.Add(gcCheckedGroupBox)
End Sub
プラットフォーム

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

参照

LayoutSettings クラス
LayoutSettings メンバ
HorizontalSpace プロパティ
HorizontalSpace プロパティ

Send Feedback