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

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

プロパティ値

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

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

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

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

    this.gcRadioGroupBox1.CheckedItemChanged += 
        new System.EventHandler<CheckedItemChangedEventArgs>(this.gcRadioGroupBox1_CheckedItemChanged);
    this.gcRadioGroupBox1.HeaderStateChange +=
        new System.EventHandler<HeaderStateChangeEventArgs>(this.gcRadioGroupBox1_HeaderStateChange);

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

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

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

    ' Initialize the layout of items by LayoutSettings.
    Me.gcRadioGroupBox1.LayoutSettings.LayoutMode = LayoutMode.Table
    Me.gcRadioGroupBox1.LayoutSettings.Orientation = System.Windows.Forms.Orientation.Vertical
    Me.gcRadioGroupBox1.LayoutSettings.RowCount = 3
    Me.gcRadioGroupBox1.LayoutSettings.HorizontalAdjustment = LineAdjustment.Distributed
    Me.gcRadioGroupBox1.LayoutSettings.VerticalAdjustment = LineAdjustment.Average

    AddHandler Me.gcRadioGroupBox1.CheckedItemChanged, AddressOf gcRadioGroupBox1_CheckedItemChanged
    AddHandler Me.gcRadioGroupBox1.HeaderStateChange, AddressOf gcRadioGroupBox1_HeaderStateChange

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

参照

GcRadioGroupBox クラス
GcRadioGroupBox メンバ

Send Feedback