匯出 (0) 列印
全部展開

Control.FontWeight 屬性

Gets or sets the weight or thickness of the specified font.

命名空間: System.Windows.Controls
組件: PresentationFramework (在 presentationframework.dll 中)
XML 命名空間:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[BindableAttribute(true)] 
public FontWeight FontWeight { get; set; }
/** @property */
public FontWeight get_FontWeight ()

/** @property */
public void set_FontWeight (FontWeight value)

public function get FontWeight () : FontWeight

public function set FontWeight (value : FontWeight)

<object FontWeight="FontWeight" .../>

屬性值

A FontWeights enumeration value. The default value is Normal.

Identifier Field

FontWeightProperty

Metadata Flags

None

The following example shows how to set the FontWeight property of a control.

<Button Name="btn5" FontWeight="Normal" Click="ChangeFontWeight">FontWeight</Button>

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.";
}

Windows Vista、Microsoft Windows XP SP2 和 Windows Server 2003 SP1 支援 Microsoft .NET Framework 3.0。

.NET Framework

支援版本:3.0

社群新增項目

新增
顯示:
© 2014 Microsoft