GrapeCity.Win.Pickers 名前空間 > ItemStyle クラス : ShowFontNamesInFont プロパティ |
次のサンプルコードは、GcFontPicker.ItemStyleプロパティ上でShowFontNamesInFontをfalseに設定して、ItemStyle.Fontの値がフォントドロップダウンリストの項目に適用されるようにします。この例を実行するには、以下のコードをSystem.Windows.Forms.Formに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出す必要があります。
private void CustomItemStyleWithFont() { this.button1.Visible = false; // 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, 10); // Use the Font set by user not the Font represented by the item. gcFontPicker.ItemStyle.ShowFontNamesInFont = false; gcFontPicker.ItemStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, GraphicsUnit.Point); // adds gcFontPicker to the form. this.Controls.Add(gcFontPicker); }
Private Sub CustomItemStyleWithFont() Me.button1.Visible = False ' 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, 10) ' Use the Font set by user not the Font represented by the item. gcFontPicker.ItemStyle.ShowFontNamesInFont = False gcFontPicker.ItemStyle.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0F, System.Drawing.FontStyle.Regular, GraphicsUnit.Point) ' 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