How can you change the highlighted text color for a WPF TextBox?

后端 未结 5 856
醉梦人生
醉梦人生 2021-01-01 23:22

The WPF TextBox natively makes use of the System Highlight color for painting the background of selected text. I would like to override this and make it consis

5条回答
  •  暖寄归人
    2021-01-02 00:02

    You can create a Style for the TextBox and write a Setter for the background. The TextBox style should be a default one so that any TextBox which comes under the visual tree will get the changed TextBox