Owner-drawn ASP.NET control?

ballisticnylon

Regular
Joined
Jul 9, 2003
Messages
82
Location
Tucson, AZ
I'm trying to write a simple color-picker that will run in a browser. So far I've got a dropDownList populated with the names of known colors. I'd like to have each ListItem also have a small box filled with the appropriate color. I know how to do this in a Windows Forms environment, but I'm at a loss as to how to accomplish the same thing in ASP.NET. Has anyone out there ever done anything similar to this?
 
While you can't add child elements to option elements, you can set their style properties.

Code:
<select>
	<option value="FF0000" style="background-color: #FF0000;">Red</option>
	<option value="FFFF00" style="background-color: #FFFF00;">Yellow</option>
	<option value="FF00FF" style="background-color: #FF00FF;">Purple</option>
	<option value="00FF00" style="background-color: #00FF00;">Green</option>
	<option value="0000FF" style="background-color: #0000FF;">Blue</option>
</select>
 
Back
Top