資訊
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.FontFamily 屬性

Gets or sets the name of the specified font.

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

[BindableAttribute(true)] 
[LocalizabilityAttribute(LocalizationCategory.Font)] 
public FontFamily FontFamily { get; set; }
/** @property */
public FontFamily get_FontFamily ()

/** @property */
public void set_FontFamily (FontFamily value)

public function get FontFamily () : FontFamily

public function set FontFamily (value : FontFamily)

<object>
  <object.FontFamily>
    <FontFamily .../>
  </object.FontFamily>
</object>
<object FontFamily="FontFamily" .../>

屬性值

A font family. The default value is the system dialog font.

Identifier Field

FontFamilyProperty

Metadata Flags

None

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

<Button Name="btn2" FontFamily="Arial" Click="ChangeFontFamily">FontFamily</Button>


ffamily = btn2.FontFamily;
str = ffamily.ToString();
if (str == ("Arial Black"))
{
    btn2.FontFamily = new FontFamily("Arial");
    btn2.Content = "FontFamily";
}
else
{
    btn2.FontFamily = new FontFamily("Arial Black");
    btn2.Content = "Control font family changes from Arial to Arial Black.";

}

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

.NET Framework

支援版本:3.0

社群新增項目

顯示:
© 2015 Microsoft