本文档已存档,并且将不进行维护。

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
显示: