disabled textbox

E

Elif

I have a texbox which can be in one of three states in my application.
1. enabled,
2. disabled,
3. read only, with a different color background.

When switching between these states, going from #3 to #1, I set the
backcolor in my program to
System.Drawing.SystemColors.Window which seems to be the default back color
for windows forms controls. However, once I set the backcolor manually,
when I disable the textbox its background doesn't change to gray the way it
normally does. It just stays with the backcolor I assigned to it, which is
white. Is there a way of assigning the default back color to a control, or
undoing the backcolor assignment?

Thanks for any help.

Elif
 
E

Elif

Thanks a lot.
ResetBackColor does work.
The strange thing is that ResetBackColor is not in the list of methods that
come up as I am typing (intellisense).
I tried it for textboxes, checkbox and combobox. It is not in the
intellisense list, but it works.
Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top