GrapeCity.Win.Containers 名前空間 > LayoutSettings クラス : Orientation プロパティ |
Public Property Orientation As Orientation
public Orientation Orientation {get; set;}
例外 | 解説 |
---|---|
System.ComponentModel.InvalidEnumArgumentException | 指定された値がSystem.Windows.Forms.Orientation値の1つではありません。 |
次のサンプルコードは、GcCheckedGroupBox.LayoutSettingsプロパティ上でOrientationプロパティをSystem.Windows.Forms.Orientation.Verticalに設定して、GcCheckedGroupBox内のチェックボックス項目を垂直にレイアウトします。この例を実行するには、以下のコードをSystem.Windows.Forms.Formに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出す必要があります。
private void InitializeLayoutSettingsWithFlowLayout() { GcCheckedGroupBox gcCheckedGroupBox = new GcCheckedGroupBox(); // Set gcRadioGroupBox1's location. gcCheckedGroupBox.Location = new Point(10, 10); gcCheckedGroupBox.Text = "Flow 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.Flow; gcCheckedGroupBox.LayoutSettings.Orientation = Orientation.Vertical; // Add gcRadioGroupBo1 to the form. this.Controls.Add(gcCheckedGroupBox); }
Private Sub InitializeLayoutSettingsWithFlowLayout() Dim gcCheckedGroupBox As New GcCheckedGroupBox() ' Set gcRadioGroupBox1's location. gcCheckedGroupBox.Location = New Point(10, 10) gcCheckedGroupBox.Text = "Flow 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.Flow gcCheckedGroupBox.LayoutSettings.Orientation = Orientation.Vertical ' 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