且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C# - 列表视图柱头高度(Windows窗体)

更新时间:2023-12-06 10:45:16

这是不容易的,但它可以做到的。

It is not easy but it can be done.

的基本策略是让从的ListView底层的头控制(使用LVM_GETHEADER消息),设置一个的NativeWindow 实例上的控制,然后收听HDM_LAYOUT消息。在该消息中,可以指定标题的位置和大小。

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.

由于 ObjectListView上述的作者,我必须说,它更容易让别人做这一切为你工作。 ObjectListView使用动态标题高度允许多行标题和垂直文本,像这样的:

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:

C# - 列表视图柱头高度(Windows窗体)

C# - 列表视图柱头高度(Windows窗体)