简体   繁体   中英

How to disable a TextBox while retaining its style

The default TextBox in WPF, once set isEnabled to False , the whole TextBox is grayed out. I want to protect the TextBox.Text from being modified and want the TextBox to remain its style ( ForeGround and Background color). Is there an easy work around to achieve this, other than to write the template to override the TextBox ?

检查或将TextBox的属性IsReadOnly设置为true。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM