FontStyleとは? わかりやすく解説

Font.Style プロパティ

この Font のスタイル情報を取得します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Dim instance As Font
Dim value As FontStyle

value = instance.Style
public FontStyle Style { get; }
public:
property FontStyle Style {
    FontStyle get ();
}
/** @property */
public FontStyle get_Style ()

プロパティ値
この Font のスタイル情報が格納されている FontStyle 列挙体。

使用例使用例

FontStyle 列挙体を使用して、ボタンの Font プロパティを新しい太字のフォントに設定する方法を次のコード例に示します。この例は、Windows フォームでの使用を意図してデザインされています。Button1 という名前のボタンを含むフォームを作成し、このフォームに次のコードを貼り付けます。ボタンの Click イベントに Button1_Click メソッドを関連付けます。

 Private Sub Button1_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button1.Click
    If Not Button1.Font.Style = FontStyle.Bold
 Then
        Button1.Font = New Font(FontFamily.GenericSansSerif, _
            12.0F, FontStyle.Bold)
    End If
End Sub
private void Button1_Click(System.Object sender,
 System.EventArgs e)
{
    if (Button1.Font.Style != FontStyle.Bold)
            Button1.Font = new Font(FontFamily.GenericSansSerif
,
            12.0F, FontStyle.Bold);
}
private:
   void Button1_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      Button1->Font = gcnew System::Drawing::Font( FontFamily::GenericSansSerif,12.0F,FontStyle::Bold
 );
   }
private void button1_Click(Object sender, System.EventArgs
 e)
{
    button1.set_Font(new Font(FontFamily.get_GenericSansSerif(),
 12,
        FontStyle.Bold));
} //button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

FontStyle 列挙体

テキストに適用するスタイル情報を指定します。

この列挙体には、メンバ値のビットごとの組み合わせを可能にする FlagsAttribute 属性が含まれています。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

<FlagsAttribute> _
Public Enumeration FontStyle
[FlagsAttribute] 
public enum FontStyle
[FlagsAttribute] 
public enum class FontStyle
/** @attribute FlagsAttribute() */ 
public enum FontStyle
FlagsAttribute 
public enum FontStyle
メンバメンバ
使用例使用例

FontStyle 列挙体を使用して、ボタンの Font プロパティを新しい太字スタイル フォントに設定する方法を次のコード例に示します。この例は、Windows フォームでの使用を意図してデザインされています。Button1 という名前のボタンを含んだフォームを作成し、このフォームに次のコードを貼り付けます。ボタンの Click イベントに Button1_Click メソッドを関連付けます。

 Private Sub Button1_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button1.Click
    If Not Button1.Font.Style = FontStyle.Bold
 Then
        Button1.Font = New Font(FontFamily.GenericSansSerif, _
            12.0F, FontStyle.Bold)
    End If
End Sub
private void Button1_Click(System.Object sender,
 System.EventArgs e)
{
    if (Button1.Font.Style != FontStyle.Bold)
            Button1.Font = new Font(FontFamily.GenericSansSerif
,
            12.0F, FontStyle.Bold);
}
private:
   void Button1_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      Button1->Font = gcnew System::Drawing::Font( FontFamily::GenericSansSerif,12.0F,FontStyle::Bold
 );
   }
private void button1_Click(Object sender, System.EventArgs
 e)
{
    button1.set_Font(new Font(FontFamily.get_GenericSansSerif(),
 12,
        FontStyle.Bold));
} //button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「FontStyle」の関連用語

FontStyleのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



FontStyleのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS