TextBoxBase.CaretBrush 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定用來繪製文字框中綴的畫筆。
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
屬性值
用來繪製文字框中插圖的畫筆。
範例
以下範例會建立 並TextBox加上文字「This is some text.」範例中將 a CaretBrush 的 和 Foreground 屬性設TextBox為藍色。
<TextBox SelectionBrush="Red" SelectionOpacity="0.5"
Foreground="Blue" CaretBrush="Blue">
This is some text.
</TextBox>
前述範例產生的輸出與以下圖示相似。
TextBox 搭配 CaretBrush 藍色