PasswordBox.CaretBrush 屬性

定義

取得或設定筆刷,這個筆刷指定密碼方塊的插入號色彩。

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

屬性值

Brush

筆刷,描述密碼方塊的插入號色彩。

範例

下列範例會建立 , PasswordBox 並將 和 Foreground 設定 CaretBrush 為紅色。

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

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

CaretBrush 設定為紅色的 PasswordBox。
已將 CaretBrush 設定為紅色的 PasswordBox

備註

您可以設定 CaretBrushPasswordBox 屬性,以指定其插入號的色彩。 例如,您可以將 設定 CaretBrush 為與 Foreground 屬性相同的值。 Foreground表示 中 PasswordBox 字元的 PasswordChar 色彩。

適用於