简体   繁体   中英

Possible to Change TextBox Style When Input Changes? (Stylesheet/Macro?)

Is it possible to create a macro or stylesheet so that when a TextBox text area is empty, it is yellow per se and when it has data it is white. I would like to accomplish this without having to explicitly call the TextChanged event.

Why not just create a new Custom Control that extends the TextBox and does what you're seeking? That way you can adjust it centrally as well. It would certainly use the TextChanged event however. Another way is to put the code in the form, but I think that would be much slower and not reusable.

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