FontFamily.ToString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Returns
The string that represents this FontFamily.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e
, which is a parameter of the Paint event handler. 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
Applies to
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示