在的WinForms ListView的可变高度的行 [英] Variable height rows in WinForms ListView

查看:206
本文介绍了在的WinForms ListView的可变高度的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能有在一个WinForms ListView的可变高度的行详细模式?

Is it possible to have variable-height rows within a WinForms ListView in Details mode?

没有的rowHeight或行[I]在控制.Height财产据我所知。

There is no RowHeight or Rows[i].Height property on the control as far as I know.

一些博客建议实施的OwnerDraw,而我做到了,但我仍然找不到任何从事件处理程序中类似height属性。

Some blogs suggests implementing OwnerDraw, which I did, but I still can't find anything resembling height property from within the event handlers.

在理想情况下,必要时行高度会自动调整大小以显示多行文本。

Ideally, the row height would auto-size to show multiline text when needed.

推荐答案

一个选项可以想到的:

要覆盖所有行项目的高度,创建一个虚拟的ImageList并将其设置为想要的高度,这取决于视图分配给列表视图或掌握的 HTTP://www.$c$cproject.com/KB/list/changerowheight.aspx

To override the item height of all rows, create a dummy ImageList and set it to the desired height and assign it to the listview depending on the view or grasp the concept of http://www.codeproject.com/KB/list/changerowheight.aspx

如果您使用 ObjectListView ,您可以更改的所有行$ P本项目高度$ ptty的轻松的。但尽管如此,也没有办法,你正在使用的ListView只要改变个别项目的高度。

If you use ObjectListView, you can change the item height of all rows pretty easily. But still, there is no way to change the individual item height as long as you are using ListView.

这篇关于在的WinForms ListView的可变高度的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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