Hi all,

I want to temporarily set the background color of a text box, so I use

my_text_box.BackColor = Color.BlanchedAlmond;

Then when I want to reset back to the default (white on my system), I
thought I could use

my_text_box.BackColor = TextBox.DefaultBackColor;

Unfortunately, this sets it to gray. Is this a bug or am I using it wrong?

Thanks

-Mat



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Re: TextBox.DefaultBackColor (C#) by Tim

Tim
Mon Jun 20 15:03:38 CDT 2005

The DefaultBackColor property is set to SystemColors.Control. Although I
don't know what that is set to on your system, I would imagine that would be
a grayish color. Try setting the BackColor to Color.Empty to reset the
BackColor to its true default.

--
Tim Wilson
.Net Compact Framework MVP

"Mat Kramer" <mkramer at transomamedical> wrote in message
news:42b71d6e$2_2@spool9-west.superfeed.net...
> Hi all,
>
> I want to temporarily set the background color of a text box, so I use
>
> my_text_box.BackColor = Color.BlanchedAlmond;
>
> Then when I want to reset back to the default (white on my system), I
> thought I could use
>
> my_text_box.BackColor = TextBox.DefaultBackColor;
>
> Unfortunately, this sets it to gray. Is this a bug or am I using it
wrong?
>
> Thanks
>
> -Mat
>
>
>
> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
News==----
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
> ----= East and West-Coast Server Farms - Total Privacy via Encryption
=----



Re: TextBox.DefaultBackColor (C#) by Claes

Claes
Tue Jun 21 02:21:53 CDT 2005

Or simply use
my_text_box.ResetBackColor();

/Claes

"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
news:eTqOsMddFHA.2664@TK2MSFTNGP15.phx.gbl...
> The DefaultBackColor property is set to SystemColors.Control. Although I
> don't know what that is set to on your system, I would imagine that would
> be
> a grayish color. Try setting the BackColor to Color.Empty to reset the
> BackColor to its true default.
>
> --
> Tim Wilson
> .Net Compact Framework MVP
>
> "Mat Kramer" <mkramer at transomamedical> wrote in message
> news:42b71d6e$2_2@spool9-west.superfeed.net...
>> Hi all,
>>
>> I want to temporarily set the background color of a text box, so I use
>>
>> my_text_box.BackColor = Color.BlanchedAlmond;
>>
>> Then when I want to reset back to the default (white on my system), I
>> thought I could use
>>
>> my_text_box.BackColor = TextBox.DefaultBackColor;
>>
>> Unfortunately, this sets it to gray. Is this a bug or am I using it
> wrong?
>>
>> Thanks
>>
>> -Mat
>>
>>
>>
>> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
> News==----
>> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
> Newsgroups
>> ----= East and West-Coast Server Farms - Total Privacy via Encryption
> =----
>
>



Re: TextBox.DefaultBackColor (C#) by Tim

Tim
Tue Jun 21 06:47:43 CDT 2005

The ResetBackColor method is hidden from the editor and I didn't want to
cause possible confusion by proposing this solution.

--
Tim Wilson
.Net Compact Framework MVP

"Claes Bergefall" <claes.bergefall@online.nospam> wrote in message
news:e7zFFHjdFHA.3864@TK2MSFTNGP10.phx.gbl...
> Or simply use
> my_text_box.ResetBackColor();
>
> /Claes
>
> "Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
> news:eTqOsMddFHA.2664@TK2MSFTNGP15.phx.gbl...
> > The DefaultBackColor property is set to SystemColors.Control. Although I
> > don't know what that is set to on your system, I would imagine that
would
> > be
> > a grayish color. Try setting the BackColor to Color.Empty to reset the
> > BackColor to its true default.
> >
> > --
> > Tim Wilson
> > .Net Compact Framework MVP
> >
> > "Mat Kramer" <mkramer at transomamedical> wrote in message
> > news:42b71d6e$2_2@spool9-west.superfeed.net...
> >> Hi all,
> >>
> >> I want to temporarily set the background color of a text box, so I use
> >>
> >> my_text_box.BackColor = Color.BlanchedAlmond;
> >>
> >> Then when I want to reset back to the default (white on my system), I
> >> thought I could use
> >>
> >> my_text_box.BackColor = TextBox.DefaultBackColor;
> >>
> >> Unfortunately, this sets it to gray. Is this a bug or am I using it
> > wrong?
> >>
> >> Thanks
> >>
> >> -Mat
> >>
> >>
> >>
> >> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
> > News==----
> >> http://www.newsfeeds.com The #1 Newsgroup Service in the World!
120,000+
> > Newsgroups
> >> ----= East and West-Coast Server Farms - Total Privacy via Encryption
> > =----
> >
> >
>
>