Bagikan melalui


Control.FontStretch Properti

Definisi

Mendapatkan atau mengatur derajat di mana font diringkas atau diperluas di layar.

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

Nilai Properti

Nilai FontStretch. Defaultnya adalah Normal.

Atribut

Contoh

Contoh berikut menunjukkan cara mengatur properti peregangan font kontrol. Untuk kemungkinan nilai peregangan, lihat 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

Keterangan

Properti ini hanya memengaruhi kontrol yang templatnya menggunakan FontStretch properti sebagai parameter. Pada kontrol lain, properti ini tidak berdampak.

Informasi Properti Dependensi

Item Nilai
Bidang pengidentifikasi FontStretchProperty
Properti metadata diatur ke true AffectsMeasure, , AffectsRenderInherits

Berlaku untuk