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

このFontInfoによって表されるSystem.Drawing.Fontのタイプを取得します。
構文
Public ReadOnly Property FontType As FontType
public FontType FontType {get;}

プロパティ値

FontType値の1つ。
使用例

次のサンプルコードは、選択されたFontInfoのすべての情報(FontTypeを含む)をLabelに表示します。このサンプルコードを実行するには、GcFontPickerインスタンスと、infoLabelという名前のSystem.Windows.Forms.Labelインスタンスを含むSystem.Windows.Forms.Formに以下のコードを追加します。そして、このイベントハンドラを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
プラットフォーム

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

参照

FontInfo クラス
FontInfo メンバ

Send Feedback