C# - Listview colum header height (Windows Form)

一个人想着一个人 提交于 2019-12-23 09:57:32

问题


How can I change the height of the column header in a ListView ?

(visual studio-2008,windows forms)


回答1:


It is not easy but it can be done.

The basic strategy is to get the underlying header control from the ListView (using LVM_GETHEADER message), setup a NativeWindow instance on that control, and then listen for HDM_LAYOUT messages. In that message, you can specify the location and size of the header.

As the author of ObjectListView mentioned above, I have to say it's much easier to let someone else do all this work for you. ObjectListView uses dynamic header height to allow multiline headers and vertical text, like this:




回答2:


Have a look at ObjectListView it supports a lot of customizations and you might find in there the way how to do it as it is open source.



来源:https://stackoverflow.com/questions/3904572/c-sharp-listview-colum-header-height-windows-form

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