FontFamily.ToString FontFamily.ToString FontFamily.ToString FontFamily.ToString Method

定義

この FontFamily をユーザーが判読できる文字列形式に変換します。Converts this FontFamily to a human-readable string representation.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

戻り値

この FontFamily を表す文字列。The string that represents this FontFamily.

次のコード例は、Windows フォームで使用するように設計さPaintEventArgsれています。これはPaint 、イベントハンドラーのパラメーターであるを必要eとします。The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. このコードは、 FontFamilyを作成し、フォントファミリの文字列形式を画面に描画します。The code creates a FontFamily and draws a string representation of the font family to the screen.

public:
   void ToString_Example( PaintEventArgs^ e )
   {
      // Create a FontFamily object.
      FontFamily^ myFontFamily = gcnew FontFamily( "Arial" );

      // Draw a string representation of myFontFamily to the screen.
      e->Graphics->DrawString( myFontFamily->ToString(), gcnew System::Drawing::Font( myFontFamily,16 ),
            Brushes::Black, PointF(0,0) );
   }
public void ToString_Example(PaintEventArgs e)
{
    // Create a FontFamily object.
    FontFamily myFontFamily = new FontFamily("Arial");
             
    // Draw a string representation of myFontFamily to the screen.
    e.Graphics.DrawString(
        myFontFamily.ToString(),
        new Font(myFontFamily, 16),
        Brushes.Black,
        new PointF(0, 0));
}
Public Sub ToString_Example(ByVal e As PaintEventArgs)

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

    ' Draw a string representation of myFontFamily to the screen.
    e.Graphics.DrawString(myFontFamily.ToString(), _
    New Font(myFontFamily, 16), Brushes.Black, New PointF(0, 0))
End Sub

適用対象