Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change textbox BackColor in code-behind

Tags:

asp.net

vb.net

How can i change textbox BackColor in code-behind to something like this:

Textbox1.BackColor = "#F2F0E1

instead of

Textbox1.BackColor = System.Drawing.White
like image 955
Fire Hand Avatar asked Oct 06 '10 06:10

Fire Hand


People also ask

How do I change BackColor in VB net?

To change the background color, select the form in Visual Studio and locate the BackColor property in the Properties panel. There are a number of ways to specify a color. Color by name - Simply type in a color name into the BackColor value field (for example Red, Yellow, Cyan etc).


1 Answers

You could try something like:

Textbox1.BackColor = System.Drawing.ColorTranslator.FromHtml("#F2F0E1");
like image 85
Cros Avatar answered Nov 03 '22 00:11

Cros