Control.FontWeight 속성

정의

지정한 글꼴의 두께 속성을 가져오거나 설정합니다.

public:
 property System::Windows::FontWeight FontWeight { System::Windows::FontWeight get(); void set(System::Windows::FontWeight value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.FontWeight FontWeight { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.FontWeight : System.Windows.FontWeight with get, set
Public Property FontWeight As FontWeight

속성 값

FontWeight

FontWeight 값입니다. 기본값은 Normal입니다.

특성

예제

다음 예제에서는 설정 하는 방법의 FontWeight 컨트롤의 속성입니다.

<Button Name="btn5" FontWeight="Normal" 
        Click="ChangeFontWeight">
  FontWeight
</Button>
void ChangeFontWeight(object sender, RoutedEventArgs e)
{
    if (btn5.FontWeight == FontWeights.Bold)
    {
        btn5.FontWeight = FontWeights.Normal;
        btn5.Content = "FontWeight";
    }
    else
    {
        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"

    Else

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

설명

이 속성에만 해당 템플릿을 사용 하 여 컨트롤을 적용 합니다 FontWeight 매개 변수로 속성입니다. 다른 컨트롤에 대해이 속성이 아무런 영향이 없습니다. 목록을 미리 정의 된 FontWeight 값, 참조는 FontWeights 클래스입니다.

종속성 속성 정보

식별자 필드 FontWeightProperty
메타 데이터 속성 설정 true AffectsMeasure, AffectsRender, Inherits

적용 대상