Bagikan melalui


TextBoxBase.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 TextBox dan menambahkan teks, "Ini adalah beberapa teks." Contoh mengatur properti menjadi SelectionBrush merah dan SelectionOpacity properti menjadi 0,5 untuk menyesuaikan tampilan teks yang dipilih.

<TextBox SelectionBrush="Red" SelectionOpacity="0.5"
         Foreground="Blue" CaretBrush="Blue">  
  This is some text.
</TextBox>

Ilustrasi berikut menunjukkan TextBox dari contoh sebelumnya dengan teks yang dipilih.

Kotak Teks dengan Kotak Teks SelectionBrush merah Teks terpilih dalam Kotak Teks dengan SelectionBrush diatur ke merah

Keterangan

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

Berlaku untuk