GrapeCity.Win.Pickers 名前空間 > GcFontPicker クラス : DisabledForeColor プロパティ |
次のサンプルコードは、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