WPF: reverting brush to default/original

前端 未结 5 825
不知归路
不知归路 2021-02-05 03:10

I\'m a complete newbie at WPF.

At the moment I\'m making a usercontrol for form elements called \"LabeledTextbox\" which contains a label, a textbox and a textblock for

5条回答
  •  一整个雨季
    2021-02-05 03:20

    You can grab the default colours from the class SystemColors

    Here is the list of all system colours: http://msdn.microsoft.com/de-de/library/system.windows.systemcolors.aspx

    Default background colour of the client area:

         _textbox.Background = SystemColors.WindowBrush;
    

    Default text colour inside the client area:

         _textbox.SystemColors.WindowTextBrush
    

提交回复
热议问题