PasswordBox.SelectionBrush 屬性

定義

取得或設定會反白顯示所選取文字的筆刷。

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

屬性值

會反白顯示所選取文字的筆刷。

範例

下列範例會建立 , PasswordBox 並將 SelectionBrush 屬性設定為綠色, SelectionOpacity 並將 屬性設定為 0.5。

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

上述範例會產生類似下圖的輸出。

將 SelectionBrush 設為綠色的 PasswordBox。
PasswordBox 中選取的文字,並將 SelectionBrush 設定為綠色

備註

您可以藉由設定 和 SelectionOpacity 屬性,指定醒目提示選取文字的 SelectionBrush 筆刷。

適用於