PowerTools PlusPak for Windows Forms 8.0J
GroupHeaderSettings クラス
メンバ  使用例 

グループボックスコントロールのヘッダに適用する設定を指定します。
構文
Public Class GroupHeaderSettings 
public class GroupHeaderSettings 
解説
GroupHeaderSettingsには通常、GcGroupBoxControlBase.HeaderSettingsを通じてアクセスします。このプロパティは、ヘッダのスタイルをカスタマイズする手段を提供します。
使用例

次のサンプルコードは、いくつかの項目を含むGcRadioGroupBoxコントロールを作成する方法を示します。また、GcRadioGroupBox.HeaderSettingsプロパティ上でGroupHeaderSettingsの一般的なプロパティを設定してヘッダの外観をカスタマイズする方法も示します。このサンプルコードを実行するには、以下のコードをSystem.Windows.Forms.Formプロジェクトに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出します。

private void CreateGcRadioGroupBoxWithHeaderSettings()
{
    GcRadioGroupBox gcRadioGroupBox1 = new GcRadioGroupBox();

    // Set gcRadioGroupBox1's location.
    gcRadioGroupBox1.Location = new Point(10, 10);
    gcRadioGroupBox1.Size = new Size(130, 100);

    // Set up the group style for this control.
    gcRadioGroupBox1.GroupStyle = GroupStyle.TopLine;

    // Set HeaderType and Header's text.
    gcRadioGroupBox1.HeaderType = HeaderType.ExpanderAndText;
    gcRadioGroupBox1.Text = "All Iems";

    // Create some radio button items.
    RadioButtonItem[] items = new RadioButtonItem[] 
    {
        new RadioButtonItem("item&1"),
        new RadioButtonItem("item&2"),
        new RadioButtonItem("item&3"),
        new RadioButtonItem("item&4"),
        new RadioButtonItem("item&5"),
    };

    // Add some items.
    gcRadioGroupBox1.Items.AddRange(items);

    // Align the header to the center of the top border.
    gcRadioGroupBox1.HeaderSettings.Alignment = HeaderAlignment.Center;

    // Enable the header's  text to ellipsis when it is too long.
    gcRadioGroupBox1.HeaderSettings.AutoEllipsis = true;

    // Set the backgroud and foreground color of the header.
    gcRadioGroupBox1.HeaderSettings.BackColor = Color.GreenYellow;
    gcRadioGroupBox1.HeaderSettings.ForeColor = Color.Tomato;

    // Set a new font to the header.
    gcRadioGroupBox1.HeaderSettings.Font =
        new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    
    // Set the effect of the header text.
    gcRadioGroupBox1.HeaderSettings.TextEffect = GrapeCity.Win.Common.TextEffect.Raised;

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

    // Add gcRadioGroupBo1 to the form.
    this.Controls.Add(gcRadioGroupBox1);
}
Private Sub CreateGcRadioGroupBoxWithHeaderSettings()
    Dim gcRadioGroupBox1 As New GcRadioGroupBox()

    ' Set gcRadioGroupBox1's location.
    gcRadioGroupBox1.Location = New Point(10, 10)
    gcRadioGroupBox1.Size = New Size(130, 100)

    ' Set up the group style for this control.
    gcRadioGroupBox1.GroupStyle = GroupStyle.TopLine

    ' Set HeaderType and Header's text.
    gcRadioGroupBox1.HeaderType = HeaderType.ExpanderAndText
    gcRadioGroupBox1.Text = "All Iems"

    ' Create some radio button items.
    Dim items As RadioButtonItem() = New RadioButtonItem() {New RadioButtonItem("item&1"), New RadioButtonItem("item&2"), New RadioButtonItem("item&3"), New RadioButtonItem("item&4"), New RadioButtonItem("item&5")}

    ' Add some items.
    gcRadioGroupBox1.Items.AddRange(items)

    ' Align the header to the center of the top border.
    gcRadioGroupBox1.HeaderSettings.Alignment = HeaderAlignment.Center

    ' Enable the header's  text to ellipsis when it is too long.
    gcRadioGroupBox1.HeaderSettings.AutoEllipsis = True

    ' Set the backgroud and foreground color of the header.
    gcRadioGroupBox1.HeaderSettings.BackColor = Color.GreenYellow
    gcRadioGroupBox1.HeaderSettings.ForeColor = Color.Tomato

    ' Set a new font to the header.
    gcRadioGroupBox1.HeaderSettings.Font = New System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

    ' Set the effect of the header text.
    gcRadioGroupBox1.HeaderSettings.TextEffect = TextEffect.Raised

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

    ' Add gcRadioGroupBo1 to the form.
    Me.Controls.Add(gcRadioGroupBox1)
End Sub
継承階層

System.Object
   GrapeCity.Win.Containers.GroupHeaderSettings

プラットフォーム

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

参照

GroupHeaderSettings メンバ
GrapeCity.Win.Containers 名前空間
HeaderSettings プロパティ
HeaderSettings プロパティ

Send Feedback