Control.DefaultFont 속성

정의

컨트롤의 기본 글꼴을 가져옵니다.

public:
 static property System::Drawing::Font ^ DefaultFont { System::Drawing::Font ^ get(); };
public static System.Drawing.Font DefaultFont { get; }
static member DefaultFont : System.Drawing.Font
Public Shared ReadOnly Property DefaultFont As Font

속성 값

컨트롤의 기본 Font입니다. 반환되는 값은 운영 체제와 시스템의 로컬 문화권 설정에 따라 다릅니다.

예외

클라이언트 컴퓨터에 기본 글꼴이나 국가별 대체 글꼴이 설치되어 있지 않은 경우

예제

다음 코드 예제를 사용 DefaultBackColor하는 방법에 설명 합니다 , DefaultFont, 및 DefaultForeColor 멤버입니다. 예제를 실행하려면 ListBox1이 포함된 ListBox 양식에 다음 코드를 붙여넣습니다. 호출 된 Populate_ListBox 폼의 생성자 또는 Load 이벤트 처리 메서드.

// The following method displays the default font, 
// background color and foreground color values for the ListBox  
// control. The values are displayed in the ListBox, itself.
void Populate_ListBox()
{
   ListBox1->Dock = DockStyle::Bottom;
   
   // Display the values in the read-only properties 
   // DefaultBackColor, DefaultFont, DefaultForecolor.
   ListBox1->Items->Add( String::Format( "Default BackColor: {0}", ListBox::DefaultBackColor ) );
   ListBox1->Items->Add( String::Format( "Default Font: {0}", ListBox::DefaultFont ) );
   ListBox1->Items->Add( String::Format( "Default ForeColor:{0}", ListBox::DefaultForeColor ) );
}

// The following method displays the default font, 
// background color and foreground color values for the ListBox  
// control. The values are displayed in the ListBox, itself.

private void Populate_ListBox()
{
    ListBox1.Dock = DockStyle.Bottom;

    // Display the values in the read-only properties 
    // DefaultBackColor, DefaultFont, DefaultForecolor.
    ListBox1.Items.Add("Default BackColor: " + 
        ListBox.DefaultBackColor.ToString());
    ListBox1.Items.Add("Default Font: " + 
        ListBox.DefaultFont.ToString());
    ListBox1.Items.Add("Default ForeColor:" + 
        ListBox.DefaultForeColor.ToString());
}

' The following method displays the default font, 
' background color and foreground color values for the ListBox  
' control. The values are displayed in the ListBox, itself.

Private Sub Populate_ListBox()
    ListBox1.Dock = DockStyle.Bottom

    ' Display the values in the read-only properties 
    ' DefaultBackColor, DefaultFont, DefaultForecolor.
    ListBox1.Items.Add("Default BackColor: " & ListBox.DefaultBackColor.ToString)
    ListBox1.Items.Add("Default Font: " & ListBox.DefaultFont.ToString)
    ListBox1.Items.Add("Default ForeColor:" & ListBox.DefaultForeColor.ToString)

End Sub

설명

다음 표에서는 운영 체제 및 로컬 문화권에 따라 에서 반환 DefaultFont 되는 값을 설명합니다.

시스템/및 또는 문화권 글꼴
Windows NT 4x, 일본어 버전 MS UI Gothic, 9포인트.
아랍어 Windows 타호마, 8점.
기타 운영 체제/문화권 MS Shell Dlg 논리 글꼴(일반적으로 Microsoft San Serif 8포인트).

MS Shell Dlg는 시스템 레지스트리의 글꼴 집합에 매핑됩니다.

이전 글꼴이 설치되지 않은 경우 기본 글꼴은 Tahoma, 8포인트입니다. 8포인트인 Tahoma가 설치되지 DefaultFont 않은 경우 속성의 GenericSansSerif 값을 반환합니다.

적용 대상

추가 정보