How to change disabled background color of TextBox in WPF

前端 未结 7 2133
野趣味
野趣味 2020-11-27 06:45

I\'ve seen the following thread which is related to my question:

WPF ComboBox: background color when disabled

The above deals with changing the Content Temp

7条回答
  •  渐次进展
    2020-11-27 07:30

    By adding  after  and before  will make your text box behave like normal winforms textbox.
    
    
    
    
        
    
    
    
    

    Code taken from following web page:

    wpf: Selecting the Text in TextBox with IsReadOnly = true?

    And style modified to match winforms. (Their appearance is enabled = false, not readonly = true)

    And of course your textbox must have IsReadOnly="True" attribute set.

提交回复
热议问题