다음을 통해 공유


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 입니다. 반환되는 값은 사용자의 운영 체제에 따라 시스템의 로컬 문화권 설정에 따라 달라집니다.

예외

기본 글꼴 또는 지역 대체 글꼴은 클라이언트 컴퓨터에 설치되지 않습니다.

예제

다음 코드 예제에서는 , DefaultFontDefaultForeColor 멤버를 DefaultBackColor사용하는 방법을 보여 줍니다. 예제를 실행하려면 다음 코드를 호출된 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 고딕, 9포인트.
아랍어 창 타호마, 8점.
기타 운영 체제/문화권 MS Shell Dlg 논리 글꼴( 일반적으로 Microsoft San Serif 8포인트)

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

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

적용 대상

추가 정보