Font.ToString 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 Font사람이 읽을 수 있는 문자열 표현을 반환합니다.
public:
override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
반환
이 Font나타내는 문자열입니다.
예제
다음 코드 예제는 Windows Forms에서 사용하도록 설계되었으며 Paint 이벤트 처리기의 매개 변수인 PaintEventArgse필요합니다. 코드는 다음 작업을 수행합니다.
Font만듭니다.
글꼴을 나타내는 문자열을 가져옵니다.
메시지 상자에 문자열을 표시합니다.
public:
void ToString_Example( PaintEventArgs^ /*e*/ )
{
// Create a Font object.
System::Drawing::Font^ myFont = gcnew System::Drawing::Font( "Arial",16 );
// Get a string that represents myFont.
String^ fontString = myFont->ToString();
// Display a message box with fontString.
MessageBox::Show( fontString );
}
public void ToString_Example(PaintEventArgs e)
{
// Create a Font object.
Font myFont = new Font("Arial", 16);
// Get a string that represents myFont.
string fontString = myFont.ToString();
// Display a message box with fontString.
MessageBox.Show(fontString);
}
Public Sub ToString_Example(ByVal e As PaintEventArgs)
' Create a Font object.
Dim myFont As New Font("Arial", 16)
' Get a string that represents myFont.
Dim fontString As String = myFont.ToString()
' Display a message box with fontString.
MessageBox.Show(fontString)
End Sub
설명
반환된 문자열의 형식은 다음과 같습니다.
[Font: Name=fontName, Size=size, Units=units, GDiCharSet=gdiCharSet, GdiVerticalFont=부울]