C# - 列表视图柱头高度(Windows窗体) [英] C# - Listview colum header height (Windows Form)

查看:542
本文介绍了C# - 列表视图柱头高度(Windows窗体)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改列标题的高度在ListView?

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

(视觉工作室,2008年,Windows窗体)

(visual studio-2008,windows forms)

推荐答案

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

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窗体)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆