Passing either RGB or HEX value to Server Control (in VS.Net 2003)

D

D Sheldon

I've created a server control that builds a table. I've exposed a public property that can change the background color of the table. When I compile the control and try to use it in a project, I am able to change the color by using the properties menu in Visual Studio.Net 2003. The problem that I'm having is that anytime that I want to enter a HEX value (rather than selecting a color from the color picker), the HEX value is converted to RGB and never displays the correct color.

Here is the code that I use to expose the color property in the server control:

Color tablebgcolor = Color.Empty;
public Color TableBGColor
{
get{return tablebgcolor;}
set{tablebgcolor = value;}
}

I've used other server controls that will accept either a HEX value or allow you select from the color picker on the properties tab in Visual Studio. Does anyone know how this is done?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,081
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top