資訊
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Control.FontStyle 屬性

Gets or sets the font style.

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

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

/** @property */
public void set_FontStyle (FontStyle value)

public function get FontStyle () : FontStyle

public function set FontStyle (value : FontStyle)

<object FontStyle="FontStyle" .../>

屬性值

A FontStyles enumeration value. The default value is Normal.

Identifier Field

FontStyleProperty

Metadata Flags

None

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

<Button Name="btn4" FontStyle="Normal" Click="ChangeFontStyle">FontStyle</Button>

if (btn4.FontStyle == FontStyles.Italic)
{
    btn4.FontStyle = FontStyles.Normal;
    btn4.Content = "FontStyle";
}
else
{
btn4.FontStyle = FontStyles.Italic;
btn4.Content = "Control font style changes from Normal to Italic.";
}

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

.NET Framework

支援版本:3.0

社群新增項目

顯示:
© 2015 Microsoft