How do I use the web colour editor in my own property grid?
I have a custom configuration tool for an application that uses the .Net PropertyGrid
control.
The classes underneath have Color
properties that are edited in the grid. If I don't decorate the attribu开发者_如何学JAVAtes at all I get a drop down colour picker that lets me choose Windows system colours.
However this is for a web site, so I want hexadecimal colour codes. I can specify these with a type converter:
[TypeConverter(typeof(WebColorConverter))]
public Color Background { ...
This fixes the input from RGB to hex, but the drop down stays as a list of Windows system colours - like this:
In Visual Studio when dealing with web controls I get a modal pop up with a hexagonal colour selector instead.
I want to get the modal web colour editor rather than the windows forms variant.
However, I looked at System.Web.UI.WebControls
colour properties and they just specify the TypeConverter
- they don't specify a UITypeEditor
.
Anyone know how to get the same editor as the web controls?
精彩评论