I'm using VS2012 with VB.NET on a winforms application. I set the BackColor property of some textboxes programmatically during my code depending on form validation. This works fine, the problem is that I'd like to "reset" the BackColor property of the textbox, so that the textbox performs as if it were in the same state before I set the BackColor. So it would do the following:
Return to the default color of white immediately after "reset"
Change to that "light gray" color when the textbox.enabled = false
The reason why I cannot simply set the BackColor to Color.White, is that this affects the textbox when textbox.enabled = false. The textbox does not return that "light gray" color after setting the backcolor and disabling the textbox. I need it to return to that color, and I'd rather not have to set the textbox's color everytime I enable or disable the textbox. Thanks!
Simply:
TextBox1.BackColor = SystemColors.Window
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With