Control.FontWeight 속성


지정한 글꼴의 두께 속성을 가져오거나 설정합니다.Gets or sets the weight or thickness of the specified font.

 property System::Windows::FontWeight FontWeight { System::Windows::FontWeight get(); void set(System::Windows::FontWeight value); };
public System.Windows.FontWeight FontWeight { get; set; }
member this.FontWeight : System.Windows.FontWeight with get, set
Public Property FontWeight As FontWeight

속성 값


FontWeight 값입니다.A FontWeight value. 기본값은 Normal입니다.The default is Normal.



다음 예제에서는 설정 하는 방법의 FontWeight 컨트롤의 속성입니다.The following example shows how to set the FontWeight property of a control.

<Button Name="btn5" FontWeight="Normal" 
void ChangeFontWeight(object sender, RoutedEventArgs e)
    if (btn5.FontWeight == FontWeights.Bold)
        btn5.FontWeight = FontWeights.Normal;
        btn5.Content = "FontWeight";
        btn5.FontWeight = FontWeights.Bold;
        btn5.Content = "Control font weight changes from Normal to Bold.";
Private Sub ChangeFontWeight(ByVal Sender As Object, ByVal e As RoutedEventArgs)

    If (btn5.FontWeight = FontWeights.Bold) Then

        btn5.FontWeight = FontWeights.Normal
        btn5.Content = "FontWeight"


        btn5.FontWeight = FontWeights.Bold
        btn5.Content = "Control font weight changes from Normal to Bold."
    End If
End Sub


이 속성에만 해당 템플릿을 사용 하 여 컨트롤을 적용 합니다 FontWeight 매개 변수로 속성입니다.This property only affects a control whose template uses the FontWeight property as a parameter. 다른 컨트롤에 대해이 속성이 아무런 영향이 없습니다.On other controls, this property has no impact. 목록을 미리 정의 된 FontWeight 값, 참조는 FontWeights 클래스입니다.For a list of predefined FontWeight values, see the FontWeights class.

종속성 속성 정보Dependency Property Information

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

적용 대상