如何获取ListView的头部高度 - C# [英] How do I get the header height of a Listview - c#

查看:1265
本文介绍了如何获取ListView的头部高度 - C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以sombody告诉我怎么去列表视图的头部高度。

Can sombody tell me how to get the header height of a list view.

感谢

推荐答案

这可能是一个有点哈克,但你可以这样做:

This might be a little bit hacky but you can do:

listView.Items[0].Bounds.Top

这只会工作,如果只有一个在列表中的项目。所以,你可能要暂时补充之一,当你第一次创建列表,并保持高度的价值。

This will only work if there is only one item in the list. So you might want to temporarily add one when you first create the list and keep the height value.

否则,您可以随时使用:

Else, you can always use:

listView.TopItem.Bounds.Top

为了使测试在任何时刻,但你仍然在列表中至少需要一个项目。

To make the test at any moment, but you still need at least one item in the list.

这篇关于如何获取ListView的头部高度 - C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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