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

GcFontPickerコントロールが無効な状態のときにコントロールの背景の描画に使用される色を取得または設定します。
構文
Public Property DisabledBackColor As Color
public Color DisabledBackColor {get; set;}

プロパティ値

GcFontPickerコントロールが無効な状態のときにコントロールの背景の描画に使用されるSystem.Drawing.Color。デフォルトはSystem.Drawing.SystemColors.Controlプロパティの値です。
使用例

次のサンプルコードは、DisabledBackColorプロパティとDisabledForeColorプロパティの使用方法を示します。このサンプルコードを実行するには、以下のコードをSystem.Windows.Forms.Formプロジェクトに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出します。

private void CreateDisabledGcFontPicker()
{
    // Create an instance of GcFontPicker control.
    GcFontPicker gcFontPicker = new GcFontPicker();

    // Initialize the Name and Location of the gcFontPicker.
    gcFontPicker.Name = "gcFontPicker";
    gcFontPicker.Location = new Point(10, 50);
    gcFontPicker.SelectedFontInfo = gcFontPicker.AllFonts[Control.DefaultFont.Name];

    // Disables gcFontPicker.
    gcFontPicker.Enabled = false;

    // Set the background color and foreground color used when gcFontPicker is in the disabled state.
    gcFontPicker.DisabledBackColor = Color.SkyBlue;
    gcFontPicker.DisabledForeColor = Color.Gold;

    // adds gcFontPicker to the form.
    this.Controls.Add(gcFontPicker);
}
Private Sub CreateDisabledGcFontPicker()
    ' Create an instance of GcFontPicker control.
    Dim gcFontPicker As New GcFontPicker()

    ' Initialize the Name and Location of the gcFontPicker.
    gcFontPicker.Name = "gcFontPicker"
    gcFontPicker.Location = New Point(10, 50)
    gcFontPicker.SelectedFontInfo = gcFontPicker.AllFonts(Control.DefaultFont.Name)

    ' Disables gcFontPicker.
    gcFontPicker.Enabled = False

    ' Set the background color and foreground color used when gcFontPicker is in the disabled state.
    gcFontPicker.DisabledBackColor = Color.SkyBlue
    gcFontPicker.DisabledForeColor = Color.Gold

    ' adds gcFontPicker to the form.
    Me.Controls.Add(gcFontPicker)
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

参照

GcFontPicker クラス
GcFontPicker メンバ
BackColor プロパティ
DisabledForeColor プロパティ
BackColor プロパティ
DisabledForeColor プロパティ

Send Feedback