TextBox.Typography Property

Gets the currently effective typography variations for the text contents of the TextBox.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

Public ReadOnly Property Typography As Typography
Dim instance As TextBox
Dim value As Typography

value = instance.Typography

/** @property */
public Typography get_Typography ()

public function get Typography () : Typography

You cannot use this property in XAML.

Property Value

A Typography object that specifies the currently effective typography variations. For a list of default typography values, see the Typography class page.

The Typography property is applicable only to OpenType fonts. A typography variant has no effect on fonts that do not support the variant. For more information on this topic, see Typography in Windows Presentation Foundation.

The following example shows how to set the Typography attribute, using Paragraph as the example element.

  FontFamily="Palatino Linotype"
    This text has some altered typography characteristics.  Note
    that use of an open type font is necessary for most typographic
    properties to be effective.
    0123456789 10 11 12 13
    1/2 2/3 3/4

The following figure shows how this example renders.

Screenshot: Text with altered typography

In contrast, the following figure shows how a similar example with default typographic properties renders.

Screenshot: Text with altered typography

The following example shows how to set the Typography property programmatically.

Paragraph par = new Paragraph();

Run runText = new Run(
    "This text has some altered typography characteristics.  Note" +
    "that use of an open type font is necessary for most typographic" +
    "properties to be effective.");
Run runNumerals = new Run("0123456789 10 11 12 13");
Run runFractions = new Run("1/2 2/3 3/4");

par.Inlines.Add(new LineBreak());
par.Inlines.Add(new LineBreak());
par.Inlines.Add(new LineBreak());
par.Inlines.Add(new LineBreak());

par.TextAlignment = TextAlignment.Left;
par.FontSize = 18;
par.FontFamily = new FontFamily("Palatino Linotype");

par.Typography.NumeralStyle = FontNumeralStyle.OldStyle;
par.Typography.Fraction = FontFraction.Stacked;
par.Typography.Variants = FontVariants.Inferior;

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0