Control.FontWeight Property

Definition

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

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; }
member this.FontWeight : System.Windows.FontWeight with get, set
Public Property FontWeight As FontWeight

Property Value

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

Examples

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

<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

Remarks

이 속성에만 해당 템플릿을 사용 하 여 컨트롤을 적용 합니다 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

Applies to