c# - Change color of groups in ObjectListView

2019-07-01 19:52发布

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条回答
Emotional °昔
2楼-- · 2019-07-01 20:33

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.

查看更多
登录 后发表回答