GrapeCity.Win.Containers 名前空間 > GcGroupBoxControlBase クラス : LayoutSettings プロパティ |
Public ReadOnly Property LayoutSettings As LayoutSettings
public LayoutSettings LayoutSettings {get;}
次のサンプルコードは、いくつかの項目を含むGcCheckedGroupBoxコントロールを作成する方法を示します。また、LayoutSettingsプロパティを使用して項目のレイアウトをカスタマイズする方法も示します。このサンプルコードを実行するには、以下のコードをSystem.Windows.Forms.Formプロジェクトに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出します。
private void CreateMyGcCheckedGroupBoxWithLayoutSettings() { 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 = System.Windows.Forms.Orientation.Vertical; gcCheckedGroupBox.LayoutSettings.RowCount = 3; gcCheckedGroupBox.LayoutSettings.HorizontalAdjustment = GrapeCity.Win.Containers.LineAdjustment.Average; gcCheckedGroupBox.LayoutSettings.VerticalAdjustment = GrapeCity.Win.Containers.LineAdjustment.Average; // Add gcRadioGroupBo1 to the form. this.Controls.Add(gcCheckedGroupBox); }
Private Sub CreateMyGcCheckedGroupBoxWithLayoutSettings() 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 = System.Windows.Forms.Orientation.Vertical gcCheckedGroupBox.LayoutSettings.RowCount = 3 gcCheckedGroupBox.LayoutSettings.HorizontalAdjustment = LineAdjustment.Average gcCheckedGroupBox.LayoutSettings.VerticalAdjustment = LineAdjustment.Average ' 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