Bagikan melalui


PasswordBox.SelectionBrush Properti

Definisi

Mendapatkan atau mengatur kuas yang menyoroti teks yang dipilih.

public:
 property System::Windows::Media::Brush ^ SelectionBrush { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
public System.Windows.Media.Brush SelectionBrush { get; set; }
member this.SelectionBrush : System.Windows.Media.Brush with get, set
Public Property SelectionBrush As Brush

Nilai Properti

Kuas yang menyoroti teks yang dipilih.

Contoh

Contoh berikut membuat PasswordBox dan mengatur SelectionBrush properti menjadi hijau dan SelectionOpacity properti menjadi 0,5.

<PasswordBox SelectionBrush="Green" SelectionOpacity="0.5" 
             Foreground="Red" CaretBrush="Red"/>

Contoh sebelumnya menghasilkan output yang mirip dengan ilustrasi berikut.

PasswordBox dengan SelectionBrush diatur ke hijau. Teks yang dipilih dalam Kotak Kata Sandi dengan SelectionBrush diatur ke hijau

Keterangan

Anda dapat menentukan kuas yang menyoroti teks yang dipilih dengan mengatur SelectionBrush properti dan SelectionOpacity .

Berlaku untuk