开发者

Datagridview cell forecolor question (winform)

I have a requirement to display a text in various colors within a datagridview cell.

I mean, within one same cell, I need to use several colors !

Which color is to be applied depends on the value of each character.

Any c开发者_如何学运维lue? Is there any other object than the datagridview (like a sort of table for instance)

If I could use several Labels within the cell, it would do the job, but how?


AFAIK you should derive your own label class from label and handle the drawing yourself.

Another approach would be handling the datagridview data binding event and creating as many labels as you need for your cell.

I would go with deriving in this case, since the implementation would consist mostly of pretty basic GDI+ stuff and is more flexible than always creating multiple labels.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜