all groups > dotnet windows forms > june 2005 >
You're in the

dotnet windows forms

group:

TextBox.DefaultBackColor (C#)


TextBox.DefaultBackColor (C#) Mat Kramer
6/20/2005 2:43:32 PM
dotnet windows forms:
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
Re: TextBox.DefaultBackColor (C#) Tim Wilson
6/20/2005 4:03:38 PM
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

[quoted text, click to view]
=----

Re: TextBox.DefaultBackColor (C#) Tim Wilson
6/21/2005 7:47:43 AM
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

[quoted text, click to view]

Re: TextBox.DefaultBackColor (C#) Claes Bergefall
6/21/2005 9:21:53 AM
Or simply use
my_text_box.ResetBackColor();

/Claes

[quoted text, click to view]

AddThis Social Bookmark Button