dotnet0824
asked on
Set TextBox color
Hi,
I would want to set the Textbox backColor using code
txtCustomer.BackColor = "&H80000005"; //I want to set this value
System.Drawing.SystemColor s can be used . But how can this value be set "&H80000005"
I would want to set the Textbox backColor using code
txtCustomer.BackColor = "&H80000005"; //I want to set this value
System.Drawing.SystemColor
You can use the ColorTranslator function like this:
Color c = System.Drawing.ColorTransl ator.FromH tml(H80000 005);
Color c = System.Drawing.ColorTransl
try
txtCustomer.BackColor = System.Drawing.Color.FromA rgb(&H8000 0005)
txtCustomer.BackColor = System.Drawing.Color.FromA
ASKER
txtCustomer.BackColor = System.Drawing.Color.FromA rgb(&H8000 0005)
(this accepts int only so error)
txtCustomer.backColor = System.Drawing.ColorTransl ator.FromH tml(H80000 005);
Doesnot Work throws error
(this accepts int only so error)
txtCustomer.backColor = System.Drawing.ColorTransl
Doesnot Work throws error
what is that color value from? what format?
and what was the error that you received from the colortranslator class.?
also, if it is html you need double quotes around the value because the FromHtml method takes a string.
ASKER
When I assign
txtCustomer.backColor = System.Drawing.ColorTransl
ERROR : Control does not support transparent background colors.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Davis,
I tried that out with NO LUCK :-( This has become highly important . Points increased to max -500
I tried that out with NO LUCK :-( This has become highly important . Points increased to max -500
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
just ColorTranslator. // and you will see your options.