c# - Change color of groups in ObjectListView

我与影子孤独终老i 提交于 2019-12-12 13:19:29

问题


When building groups in ObjectListView, how do I change the color of the group? In default groups are shown with a dark blue line in dark blue forecolor. How can I change it?


回答1:


Its apparently not possible. There was a discussion about the ability to change the group header font/style several years ago. I don't know if that still represents the actual situation, but I wasn't able to come up with a solution when I was looking for it several weeks ago.

Even using the undocumented ListView API's, there is no mechanism to change anything about how a group header is rendered. You can't change the font, color, background color, anything.

Well, under XP only, you can change the color of the group header (via the SetGroupMetrics message). But under Vista and later, that ability was removed.



来源:https://stackoverflow.com/questions/32700669/c-sharp-change-color-of-groups-in-objectlistview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!