开发者

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:

How do I use the web colour editor in my own property grid?

In Visual Studio when dealing with web controls I get a modal pop up with a hexagonal colour selector instead.

How do I use the web colour editor in my own property grid?

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜