PowerTools PlusPak for Windows Forms 8.0J
AllFontsText プロパティ
使用例 

AllFontsグループのキャプションを取得または設定します。
構文
Public Property AllFontsText As String
public string AllFontsText {get; set;}

プロパティ値

AllFontsグループのキャプションを表すSystem.String。デフォルトは"すべてのフォント"です。
使用例

次のサンプルコードは、GcFontPicker.ItemGroupStyleプロパティ上でAllFontsTextプロパティを設定して、フォントドロップダウンリストのAllFontsグループのキャプションを設定します。この例を実行するには、以下のコードをSystem.Windows.Forms.Formに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出す必要があります。

private void CreateGcFontPickerWithItemGroupStyle()
{
    // 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);

    // Set the BackColor and ForeColor of the groups.
    gcFontPicker.ItemGroupStyle.BackColor = Color.Green;
    gcFontPicker.ItemGroupStyle.ForeColor = Color.Gold;

    // Set the Font of the groups.
    gcFontPicker.ItemGroupStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, GraphicsUnit.Point);

    // Set the caption of all fonts group.
    gcFontPicker.ItemGroupStyle.AllFontsText = "My All Fonts";

    // Set the caption of preferred fonts group.
    gcFontPicker.ItemGroupStyle.PreferredFontsText = "My Preferred Fonts";
    // Add some items to the preferred fonts in order to show the group.
    gcFontPicker.PreferredFonts.AddRange(new FontInfo[] 
    {
        gcFontPicker.AllFonts["MingLiU"],
        gcFontPicker.AllFonts["MS UI Gothic"],
    });

    // Set the caption of recently used fonts.
    gcFontPicker.ItemGroupStyle.RecentlyUsedFontsText = "My Recently Used Fonts";
    // Add some items to the recently used fonts in order to show the group.
    gcFontPicker.RecentlyUsedFonts.AddRange(new FontInfo[] 
    {
        gcFontPicker.AllFonts["Nina"],
        gcFontPicker.AllFonts["Vrinda"]
    });

    // adds gcFontPicker to the form.
    this.Controls.Add(gcFontPicker);
}
Private Sub CreateGcFontPickerWithItemGroupStyle()
    ' 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)

    ' Set the BackColor and ForeColor of the groups.
    gcFontPicker.ItemGroupStyle.BackColor = Color.Green
    gcFontPicker.ItemGroupStyle.ForeColor = Color.Gold

    ' Set the Font of the groups.
    gcFontPicker.ItemGroupStyle.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, GraphicsUnit.Point)

    ' Set the caption of all fonts group.
    gcFontPicker.ItemGroupStyle.AllFontsText = "My All Fonts"

    ' Set the caption of preferred fonts group.
    gcFontPicker.ItemGroupStyle.PreferredFontsText = "My Preferred Fonts"
    ' Add some items to the preferred fonts in order to show the group.
    gcFontPicker.PreferredFonts.AddRange(New FontInfo() {gcFontPicker.AllFonts("MingLiU"), gcFontPicker.AllFonts("MS UI Gothic")})

    ' Set the caption of recently used fonts.
    gcFontPicker.ItemGroupStyle.RecentlyUsedFontsText = "My Recently Used Fonts"
    ' Add some items to the recently used fonts in order to show the group.
    gcFontPicker.RecentlyUsedFonts.AddRange(New FontInfo() {gcFontPicker.AllFonts("Nina"), gcFontPicker.AllFonts("Vrinda")})

    ' 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

参照

ItemGroupStyle クラス
ItemGroupStyle メンバ

Send Feedback