开发者

Unable to change row header background color din XP display style but works in classic display style

I have a Windows form DataGridView. I am dynamically changing the background color of the row header. The background color is getting successfully changed if the OS display style is classic. However, background color of the row header does not change if the display style is Windows XP.

Please note, I am able to change the background color of the row, though. Can anybody tell me what I am doing wrong?

I am changing the background color of t开发者_高级运维he row header in cell formatting event.


You need to set the EnableHeadersVisualStyles property on the DataGridView to false, otherwise it will render the headers using visual styles (i.e. the XP style, or Aero on Vista/7).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜