BackgroundColor of a disabled TextBox

前端 未结 2 1959
傲寒
傲寒 2021-01-12 06:06

I have a TextBox that is defined through a ControlTemplate. Because of the ControlTemplate, the TextBox is no more automatically grayed out when the IsEnabled-property is se

2条回答
  •  失恋的感觉
    2021-01-12 07:02

    The following StackOverflow question may help:

    Visual guide to System.Windows.SystemColors

    Edit:

    I did some additional sleuthing and looked at the standard XAML styles that Microsoft provides (see Where can I download Microsoft's standard WPF themes from?). You can see exactly which SystemColors values are used for various controls.

    For example, here is a snippet of the control template for ComboBox:

    
        ...
        
        ...
    
    

    Microsoft uses SystemColors.ControlBrushKey as the background color of a disabled ComboBox.

提交回复
热议问题