PowerTools MultiRow for Windows Forms 8.0J
CharSets プロパティ (FontInfo)
使用例 

このFontInfoによって表されるSystem.Drawing.FontでサポートされるFontCharSetのコレクションを取得します。
構文
Public ReadOnly Property CharSets As CharSetCollection
public CharSetCollection CharSets {get;}

プロパティ値

このFontInfoによって表されるSystem.Drawing.FontでサポートされるすべてのFontCharSetを含む読み取り専用コレクション。
解説
このプロパティを使用すると、このFontInfoによって表されるSystem.Drawing.Fontでサポートされる文字セットを取得できます。
使用例

次のサンプルコードは、選択されたFontInfoのすべての情報(サポートされている文字セットを含む)をLabelに表示します。このサンプルコードを実行するには、GcFontPickerインスタンスと、infoLabelという名前のSystem.Windows.Forms.Labelインスタンスを含むSystem.Windows.Forms.Formに以下のコードを追加します。そして、このイベントハンドラをGcFontPickerインスタンスのGcFontPicker.SelectedFontChangedイベントに関連付けます。

private void DisplaySelectedFontInfo(object sender, EventArgs e)
{
    StringBuilder infoString = new StringBuilder();

    // Get the selected FontInfo.
    FontInfo fontInfo = (sender as GcFontPicker).SelectedFontInfo;

    infoString.AppendLine("Font Name: " + fontInfo.Name);
    infoString.AppendLine("Font Description: " + fontInfo.Description);
    infoString.AppendLine("IsSysbolFont: " + fontInfo.IsSymbolFont);
    infoString.AppendLine("IsMonospacedFont: " + fontInfo.IsMonospacedFont);
    infoString.AppendLine("Font Type: " + fontInfo.FontType);
    infoString.AppendLine("Support CharSets: " + fontInfo.CharSets.ToString());

    // Assign the font information to the Text of infoLabel to display the info.
    infoLabel.Text = infoString.ToString();
}
Private Sub DisplaySelectedFontInfo(ByVal sender As Object, ByVal e As EventArgs)
    Dim infoString As New StringBuilder()

    ' Get the selected FontInfo.
    Dim fontInfo As FontInfo = TryCast(sender, GcFontPicker).SelectedFontInfo

    infoString.AppendLine("Font Name: " + fontInfo.Name)
    infoString.AppendLine("Font Description: " + fontInfo.Description)
    infoString.AppendLine("IsSysbolFont: " + fontInfo.IsSymbolFont)
    infoString.AppendLine("IsMonospacedFont: " + fontInfo.IsMonospacedFont)
    infoString.AppendLine("Font Type: " + fontInfo.FontType)
    infoString.AppendLine("Support CharSets: " + fontInfo.CharSets.ToString())

    ' Assign the font information to the Text of infoLabel to display the info.
    infoLabel.Text = infoString.ToString()
End Sub
参照

FontInfo クラス
FontInfo メンバ

 

 


© 2008-2015 GrapeCity inc. All rights reserved.