Control.FontFamily 속성

정의

컨트롤의 글꼴 패밀리를 가져오거나 설정합니다.Gets or sets the font family of the control.

public:
 property System::Windows::Media::FontFamily ^ FontFamily { System::Windows::Media::FontFamily ^ get(); void set(System::Windows::Media::FontFamily ^ value); };
[System.ComponentModel.Bindable(true)]
[System.Windows.Localizability(System.Windows.LocalizationCategory.Font)]
public System.Windows.Media.FontFamily FontFamily { get; set; }
member this.FontFamily : System.Windows.Media.FontFamily with get, set
Public Property FontFamily As FontFamily

속성 값

글꼴 패밀리입니다.A font family. 기본값은 시스템 대화 상자 글꼴입니다.The default is the system dialog font.

특성

예제

다음 예제에서는 컨트롤의 글꼴 패밀리 속성을 설정 하는 방법을 보여 줍니다.The following example shows how to set the font family property of a control.

<Button Name="btn2" FontFamily="Arial" 
        Click="ChangeFontFamily">
  FontFamily
</Button>
void ChangeFontFamily(object sender, RoutedEventArgs e)
{

    ffamily = btn2.FontFamily;
    str = ffamily.ToString();
    if (str == ("Arial Black"))
    {
        btn2.FontFamily = new FontFamily("Arial");
        btn2.Content = "FontFamily";
    }
    else
    {
        btn2.FontFamily = new FontFamily("Arial Black");
        btn2.Content = "Control font family changes from Arial to Arial Black.";

    }
}
Private Sub ChangeFontFamily(ByVal Sender As Object, ByVal e As RoutedEventArgs)

    ffamily = btn2.FontFamily
    str = ffamily.ToString()
    If (str = ("Arial Black")) Then

        btn2.FontFamily = New FontFamily("Arial")
        btn2.Content = "FontFamily"

    Else

        btn2.FontFamily = New FontFamily("Arial Black")
        btn2.Content = "Control font family changes from Arial to Arial Black."

    End If
End Sub

설명

이 속성에만 해당 템플릿을 사용 하 여 컨트롤을 적용 합니다 FontFamily 매개 변수로 속성입니다.This property only affects a control whose template uses the FontFamily property as a parameter. 다른 컨트롤에 대해이 속성이 아무런 영향이 없습니다.On other controls, this property has no impact.

종속성 속성 정보Dependency Property Information

식별자 필드Identifier field FontFamilyProperty
메타 데이터 속성 설정 trueMetadata properties set to true AffectsMeasure, AffectsRender, InheritsAffectsMeasure, AffectsRender, Inherits

적용 대상