GrapeCity.Win.Containers 名前空間 > LayoutSettings クラス : LayoutMode プロパティ |
Public Property LayoutMode As LayoutMode
public LayoutMode LayoutMode {get; set;}
例外 | 解説 |
---|---|
System.ComponentModel.InvalidEnumArgumentException | 指定された値がLayoutMode値の1つではありません。 |
次のサンプルコードは、GcCheckedGroupBox.LayoutSettingsプロパティ上でLayoutModeプロパティをLayoutMode.Tableに設定して、チェックボックス項目を表形式でレイアウトします。この例を実行するには、以下のコードを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