PowerTools PlusPak for Windows Forms 8.0J
HeaderType プロパティ (GcCheckedGroupBox)
使用例 

GcCheckedGroupBoxコントロールで使用するヘッダのタイプを決定する値を取得または設定します。
構文
Public Property HeaderType As HeaderType
public HeaderType HeaderType {get; set;}

プロパティ値

HeaderType値の1つ。デフォルト値はHeaderType.Textです。
例外
例外解説
System.ComponentModel.InvalidEnumArgumentException指定された値がHeaderType値の1つではありません。
使用例
次のサンプルコードは、HeaderTypeプロパティをHeaderType.ExpanderAndTextに設定して、その内容を展開または折りたたむことができるGcCheckedGroupBoxを作成します。このサンプルコードは、GcCheckedGroupBoxクラスの概要に示されている詳細なコード例の一部を抜粋したものです。
private void InitializeMyGcCheckedGroupBox()
{
    // Set the header text by setting Text property.
    this.gcCheckedGroupBox1.Text = "&Collapse All";

    // Enable gcCheckedGroupBox1 to expand or collapse. 
    this.gcCheckedGroupBox1.HeaderType = HeaderType.ExpanderAndText;

    // Create a top-line border group box.
    this.gcCheckedGroupBox1.GroupStyle = GroupStyle.TopLine;

    // Initialize the layout of items by LayoutSettings.
    this.gcCheckedGroupBox1.LayoutSettings.LayoutMode = LayoutMode.Table;
    this.gcCheckedGroupBox1.LayoutSettings.Orientation = System.Windows.Forms.Orientation.Vertical;
    this.gcCheckedGroupBox1.LayoutSettings.RowCount = 3;
    this.gcCheckedGroupBox1.LayoutSettings.HorizontalAdjustment = GrapeCity.Win.Containers.LineAdjustment.Distributed;
    this.gcCheckedGroupBox1.LayoutSettings.VerticalAdjustment = GrapeCity.Win.Containers.LineAdjustment.Average;

    this.gcCheckedGroupBox1.ItemCheckedChanged +=
        new System.EventHandler<GrapeCity.Win.Containers.CheckBoxItemEventArgs>(this.gcCheckedGroupBox1_ItemCheckedChanged);
    this.gcCheckedGroupBox1.HeaderStateChange +=
        new System.EventHandler<GrapeCity.Win.Containers.HeaderStateChangeEventArgs>(this.gcCheckedGroupBox1_HeaderStateChange);

    // Create and add some items.
    CheckBoxItem[] items = new CheckBoxItem[] 
    {
        new CheckBoxItem("item1"),
        new CheckBoxItem("item2",true),
        new CheckBoxItem("item3"),
        new CheckBoxItem("item4", true),
        new CheckBoxItem("item5", true),
    };
    this.gcCheckedGroupBox1.Items.AddRange(items);
}
Private Sub InitializeMyGcCheckedGroupBox()
    ' Set the header text by setting Text property.
    Me.gcCheckedGroupBox1.Text = "&Collapse All"

    ' Enable gcCheckedGroupBox1 to expand or collapse. 
    Me.gcCheckedGroupBox1.HeaderType = HeaderType.ExpanderAndText

    ' Create a top-line border group box.
    Me.gcCheckedGroupBox1.GroupStyle = GroupStyle.TopLine

    ' Initialize the layout of items by LayoutSettings.
    Me.gcCheckedGroupBox1.LayoutSettings.LayoutMode = LayoutMode.Table
    Me.gcCheckedGroupBox1.LayoutSettings.Orientation = System.Windows.Forms.Orientation.Vertical
    Me.gcCheckedGroupBox1.LayoutSettings.RowCount = 3
    Me.gcCheckedGroupBox1.LayoutSettings.HorizontalAdjustment = LineAdjustment.Distributed
    Me.gcCheckedGroupBox1.LayoutSettings.VerticalAdjustment = LineAdjustment.Average
    AddHandler Me.gcCheckedGroupBox1.ItemCheckedChanged, AddressOf gcCheckedGroupBox1_ItemCheckedChanged
    AddHandler Me.gcCheckedGroupBox1.HeaderStateChange, AddressOf gcCheckedGroupBox1_HeaderStateChange

    ' Create and add some items.
    Dim items As CheckBoxItem() = New CheckBoxItem() {New CheckBoxItem("item1"), New CheckBoxItem("item2", True), New CheckBoxItem("item3"), New CheckBoxItem("item4", True), New CheckBoxItem("item5", True)}
    Me.gcCheckedGroupBox1.Items.AddRange(items)
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

参照

GcCheckedGroupBox クラス
GcCheckedGroupBox メンバ
HeaderType 列挙体
HeaderType 列挙体

Send Feedback