Control.FontWeight Control.FontWeight Control.FontWeight Control.FontWeight Property

定義

指定したフォントの太さを取得または設定します。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

プロパティ値

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" 
        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プロパティをパラメーターとして。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 AffectsMeasureAffectsRenderInheritsAffectsMeasure, AffectsRender, Inherits

適用対象