FontFamily.IsStyleAvailable メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > FontFamily.IsStyleAvailable メソッドの意味・解説 

FontFamily.IsStyleAvailable メソッド

指定した FontStyle 列挙体が使用可能かどうか示します

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

Public Function IsStyleAvailable ( _
    style As FontStyle _
) As Boolean
Dim instance As FontFamily
Dim style As FontStyle
Dim returnValue As Boolean

returnValue = instance.IsStyleAvailable(style)
public bool IsStyleAvailable (
    FontStyle style
)
public:
bool IsStyleAvailable (
    FontStyle style
)
public boolean IsStyleAvailable (
    FontStyle style
)
public function IsStyleAvailable (
    style : FontStyle
) : boolean

パラメータ

style

テスト対象の FontStyle。

戻り値
指定した FontStyle使用できる場合trueそれ以外場合false

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

Public Sub IsStyleAvailable_Example(ByVal
 e As PaintEventArgs)

    ' Create a FontFamily object.
    Dim myFontFamily As New
 FontFamily("Arial")

    ' Test whether myFontFamily is available in Italic.
    If myFontFamily.IsStyleAvailable(FontStyle.Italic) Then

        ' Create a Font object using myFontFamily.
        Dim familyFont As New
 Font(myFontFamily, 16, FontStyle.Italic)

        ' Use familyFont to draw text to the screen.
        e.Graphics.DrawString(myFontFamily.Name & _
        " is available in Italic", familyFont, Brushes.Black,
 _
        New PointF(0, 0))
    End If
End Sub
public void IsStyleAvailable_Example(PaintEventArgs
 e)
{
    // Create a FontFamily object.
    FontFamily myFontFamily = new FontFamily("Arial");
             
    // Test whether myFontFamily is available in Italic.
    if(myFontFamily.IsStyleAvailable(FontStyle.Italic))
    {
             
        // Create a Font object using myFontFamily.
        Font familyFont = new Font(myFontFamily, 16, FontStyle.Italic);
             
        // Use familyFont to draw text to the screen.
        e.Graphics.DrawString(
            myFontFamily.Name + " is available in Italic"
,
            familyFont,
            Brushes.Black,
            new PointF(0, 0));
    }
}
public:
   void IsStyleAvailable_Example( PaintEventArgs^ e )
   {
      // Create a FontFamily object.
      FontFamily^ myFontFamily = gcnew FontFamily( "Arial" );

      // Test whether myFontFamily is available in Italic.
      if ( myFontFamily->IsStyleAvailable( FontStyle::Italic
 ) )
      {
         // Create a Font object using myFontFamily.
         System::Drawing::Font^ familyFont = gcnew System::Drawing::Font( myFontFamily,16,FontStyle::Italic
 );

         // Use familyFont to draw text to the screen.
         e->Graphics->DrawString( myFontFamily->Name + " is available
 in Italic",
               familyFont, Brushes::Black, PointF(0,0) );
      }
   }
public void IsStyleAvailable_Example(PaintEventArgs
 e)
{
    // Create a FontFamily object.
    FontFamily myFontFamily = new FontFamily("Arial");

    // Test whether myFontFamily is available in Italic.
    if (myFontFamily.IsStyleAvailable(FontStyle.Italic)) {
        // Create a Font object using myFontFamily.
        Font familyFont = new Font(myFontFamily, 16, FontStyle.Italic);

        // Use familyFont to draw text to the screen.
        e.get_Graphics().DrawString(myFontFamily.get_Name()  
            + " is available in Italic", familyFont,
 
            Brushes.get_Black(), new PointF(0, 0));
    }
} //IsStyleAvailable_Example
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

FontFamily.IsStyleAvailable メソッドのお隣キーワード
検索ランキング

   

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



FontFamily.IsStyleAvailable メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS