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

Re: disabled textbox by Claes

Claes
Wed Feb 11 03:24:05 CST 2004

ResetBackColor might work

/claes

"Elif" <efanuscu@mednet.ucla.edu> wrote in message
news:c0bt2g$pdj$1@daisy.noc.ucla.edu...
> 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
>
>



Re: disabled textbox by Elif

Elif
Wed Feb 11 11:40:20 CST 2004

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.


"Claes Bergefall" <claes.bergefall.nospam@frontec.se> wrote in message
news:uETdQDI8DHA.2116@TK2MSFTNGP10.phx.gbl...
> ResetBackColor might work
>
> /claes
>
> "Elif" <efanuscu@mednet.ucla.edu> wrote in message
> news:c0bt2g$pdj$1@daisy.noc.ucla.edu...
> > 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
> >
> >
>
>