PowerTools MultiRow for Windows Forms 8.0J
FilterFontTypes 列挙体
使用例 使用例 

フォントをフィルタリングするためにGcFontPickerで使用されるフォントのタイプを定義します。
構文
Public Enum FilterFontTypes 
   Inherits System.Enum
public enum FilterFontTypes : System.Enum 
メンバ
メンバ解説
All現在のオペレーティングシステムにインストールされているすべてのフォントをGcFontPickerコントロールのドロップダウンリストに表示することを指定します。
MonospacedFontすべてのモノスペースフォントをGcFontPickerコントロールのドロップダウンリストに表示することを指定します。
NoneGcFontPickerコントロールのドロップダウンリストにどのフォントも表示しないことを指定します。
NormalFontシンボルフォントとモノスペースフォントを除くすべての通常フォントをGcFontPickerコントロールのドロップダウンリストに表示することを指定します。
OpenTypeFontすべてのOpenTypeフォントをGcFontPickerコントロールのドロップダウンリストに表示することを指定します。
SymbolFontすべてのシンボルフォントをGcFontPickerコントロールのドロップダウンリストに表示することを指定します。
TrueTypeFontすべてのTrueTypeフォントをGcFontPickerコントロールのドロップダウンリストに表示することを指定します。
解説
この列挙体を使用して、GcFontPickerコントロールのドロップダウンリストに表示されるリストをフィルタリングできます。この場合、GcFontPickerコントロールには、ユーザーが指定したFilterFontTypesタイプのフォントだけが表示されます。フォントタイプでフォントをフィルタリングするには、このGcFontPickerコントロールに関連付けられたGcFontPicker.ItemFilterFontInfoFilter.FontTypesプロパティを指定する必要があります。
使用例

次のサンプルコードは、この列挙体を使用して、GcFontPickerのドロップダウンリストのすべてのフォントグループに表示されるフォント名をフィルタリングする方法を示します。この例では、OpenTypeフォントのうち日本語文字セットと簡体字中国語文字セットをサポートするフォントのみをすべてのフォントグループに表示しています。このサンプルコードを実行するには、以下のコードをSystem.Windows.Forms.Formプロジェクトに追加し、ここで作成したメソッドをコンストラクターまたはフォーム上の別のメソッドから呼び出します。

private void CreateGcFontPickerWithItemFilter()
{
    // 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 ItemFilter.
    gcFontPicker.ItemFilter.FontTypes = FilterFontTypes.OpenTypeFont;
    gcFontPicker.ItemFilter.CharSets = new CharSetCollection(new FontCharSet[] { FontCharSet.Japanese , FontCharSet.Chinese_Simplified});

    // adds gcFontPicker to the form.
    this.Controls.Add(gcFontPicker);
}
Private Sub CreateGcFontPickerWithItemFilter()
    ' 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 ItemFilter.
    gcFontPicker.ItemFilter.FontTypes = FilterFontTypes.OpenTypeFont
    gcFontPicker.ItemFilter.CharSets = New CharSetCollection(New FontCharSet() {FontCharSet.Japanese, FontCharSet.Chinese_Simplified})

    ' adds gcFontPicker to the form.
    Me.Controls.Add(gcFontPicker)
End Sub
継承階層

System.Object
   System.ValueType
      System.Enum
         GrapeCity.Win.Pickers.FilterFontTypes

参照

GrapeCity.Win.Pickers 名前空間

 

 


© 2008-2015 GrapeCity inc. All rights reserved.