Control.FontStretch Propriedade

Definição

Obtém ou define o grau em que uma fonte é condensada ou expandida no ecrã.

public:
 property System::Windows::FontStretch FontStretch { System::Windows::FontStretch get(); void set(System::Windows::FontStretch value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.FontStretch FontStretch { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.FontStretch : System.Windows.FontStretch with get, set
Public Property FontStretch As FontStretch

Valor de Propriedade

Um valor de FontStretch. A predefinição é Normal.

Atributos

Exemplos

O exemplo seguinte mostra como definir a propriedade de alongamento da fonte de um controlo. Para possíveis valores de estiramento, veja FontStretches.

<Button Name="btn10" FontStretch ="Condensed" 
        Click="ChangeFontStretch" TabIndex="3">
  FontStretch
</Button>
void ChangeFontStretch(object sender, RoutedEventArgs e)
{
    if (btn10.FontStretch == FontStretches.Condensed)
    {
        btn10.FontStretch = FontStretches.Normal;
        btn10.Content = "Control FontStretch changes from Condensed to Normal.";
    }
    else
    {
        btn10.FontStretch = FontStretches.Condensed;
        btn10.Content = "FontStretch";
    }
}
Private Sub ChangeFontStretch(ByVal Sender As Object, ByVal e As RoutedEventArgs)

    If (btn10.FontStretch = FontStretches.Condensed) Then

        btn10.FontStretch = FontStretches.Normal
        btn10.Content = "Control FontStretch changes from Condensed to Normal."
    Else
        btn10.Content = "FontStretch"
        btn10.FontStretch = FontStretches.Condensed
    End If

End Sub

Observações

Esta propriedade afeta apenas um controlo cujo template usa a FontStretch propriedade como parâmetro. Noutros controlos, esta propriedade não tem impacto.

Informação de Propriedade de Dependência

Número Value
Campo identificador FontStretchProperty
Propriedades dos metadados definidas como true AffectsMeasure, AffectsRender, Inherits

Aplica-se a