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

チェック状態とマウス状態を示すために使用される境界線の外観と色を取得します。
構文
Public ReadOnly Property FlatAppearance As FlatButtonAppearance
public FlatButtonAppearance FlatAppearance {get;}

プロパティ値

GrapeCity.Win.Buttons.FlatButtonAppearance値の1つ。
解説
FlatAppearanceプロパティは、外観がSystem.Windows.Forms.Appearance.Buttonで、GrapeCity.Win.Common.FlatStyleExがFlatに設定されている項目に対してのみ使用してください。
使用例

次のサンプルコードは、GcRadioGroupBox.HeaderSettingsプロパティ上でFlatAppearanceプロパティを設定して、すべてのチェックボックス項目にフラットな外観を設定します。このサンプルコードを実行するには、以下のコードをSystem.Windows.Forms.Formプロジェクトに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出します。

private void CreateMyGcCheckedGroupBoxWithItemSettings()
{
    GcCheckedGroupBox gcCheckedGroupBox = new GcCheckedGroupBox();

    // Set gcRadioGroupBox1's location.
    gcCheckedGroupBox.Location = new Point(10, 10);
    gcCheckedGroupBox.Text = "Button appearance items";

    // Create some radio button items.
    CheckBoxItem[] items = new CheckBoxItem[] 
    {
        new CheckBoxItem("item1"),
        new CheckBoxItem("item2"),
        new CheckBoxItem("item3"),
    };

    // First add some items.
    gcCheckedGroupBox.Items.AddRange(items);

    // Use flat theme to draw gcCheckedGroupBox.
    gcCheckedGroupBox.FlatStyle = GrapeCity.Win.Common.FlatStyleEx.Flat;

    // Set all items as button appearance.
    gcCheckedGroupBox.ItemSettings.Appearance = Appearance.Button;

    gcCheckedGroupBox.ItemSettings.UseVisualStyleBackColor = false;

    // Set all items' background and foreground color.
    gcCheckedGroupBox.ItemSettings.BackColor = Color.AliceBlue;
    gcCheckedGroupBox.ItemSettings.ForeColor = Color.Blue;

    // Set all items' font.
    gcCheckedGroupBox.ItemSettings.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    
    // Set all items' TextEffect.
    gcCheckedGroupBox.ItemSettings.TextEffect = GrapeCity.Win.Common.TextEffect.Raised;

    // Customize the flat appearance.
    gcCheckedGroupBox.ItemSettings.FlatAppearance.BorderColor = Color.Violet;
    gcCheckedGroupBox.ItemSettings.FlatAppearance.BorderSize = 2;
    gcCheckedGroupBox.ItemSettings.FlatAppearance.CheckedBackColor = Color.Red;
    gcCheckedGroupBox.ItemSettings.FlatAppearance.MouseDownBackColor = Color.RosyBrown;
    gcCheckedGroupBox.ItemSettings.FlatAppearance.MouseOverBackColor = Color.Silver;

    // Customize the layout of items.
    gcCheckedGroupBox.LayoutSettings.LayoutMode = LayoutMode.Flow;
    gcCheckedGroupBox.LayoutSettings.HorizontalSpace = 5;

    // Add gcRadioGroupBox to the form.
    this.Controls.Add(gcCheckedGroupBox);
}
Private Sub CreateMyGcCheckedGroupBoxWithItemSettings()
    Dim gcCheckedGroupBox As New GcCheckedGroupBox()

    ' Set gcRadioGroupBox1's location.
    gcCheckedGroupBox.Location = New Point(10, 10)
    gcCheckedGroupBox.Text = "Button appearance items"

    ' Create some radio button items.
    Dim items As CheckBoxItem() = New CheckBoxItem() {New CheckBoxItem("item1"), New CheckBoxItem("item2"), New CheckBoxItem("item3")}

    ' First add some items.
    gcCheckedGroupBox.Items.AddRange(items)

    ' Use flat theme to draw gcCheckedGroupBox.
    gcCheckedGroupBox.FlatStyle = FlatStyleEx.Flat

    ' Set all items as button appearance.
    gcCheckedGroupBox.ItemSettings.Appearance = Appearance.Button

    gcCheckedGroupBox.ItemSettings.UseVisualStyleBackColor = False

    ' Set all items' background and foreground color.
    gcCheckedGroupBox.ItemSettings.BackColor = Color.AliceBlue
    gcCheckedGroupBox.ItemSettings.ForeColor = Color.Blue

    ' Set all items' font.
    gcCheckedGroupBox.ItemSettings.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

    ' Set all items' TextEffect.
    gcCheckedGroupBox.ItemSettings.TextEffect = TextEffect.Raised

    ' Customize the flat appearance.
    gcCheckedGroupBox.ItemSettings.FlatAppearance.BorderColor = Color.Violet
    gcCheckedGroupBox.ItemSettings.FlatAppearance.BorderSize = 2
    gcCheckedGroupBox.ItemSettings.FlatAppearance.CheckedBackColor = Color.Red
    gcCheckedGroupBox.ItemSettings.FlatAppearance.MouseDownBackColor = Color.RosyBrown
    gcCheckedGroupBox.ItemSettings.FlatAppearance.MouseOverBackColor = Color.Silver

    ' Customize the layout of items.
    gcCheckedGroupBox.LayoutSettings.LayoutMode = LayoutMode.Flow
    gcCheckedGroupBox.LayoutSettings.HorizontalSpace = 5

    ' Add gcRadioGroupBox 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

参照

GroupItemSettings クラス
GroupItemSettings メンバ

Send Feedback