WinForms ListView 控件上的多行列表项? [英] Multi-line list items on WinForms ListView control?

查看:22
本文介绍了WinForms ListView 控件上的多行列表项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在标准的 Winforms 列表视图控件中显示多行文本?

解决方案

如果你想在 ListView 中显示多行文本,请查看

请记住,ListView 不能 具有不同高度的行.在上面的屏幕截图中,我不能让第一行和第三行更高以显示更多文本,而其他行更短.每一行的高度必须相同.

如果能够拥有不同高度的行对您来说是必不可少的,那么 ListView 将不是您的解决方案.您可能需要考虑 Matthew Hall 出色的 XPTable其更新项目,以及Lee Paul Alexander 的精彩 Outlook 风格列表.

Is there a way to display multi-line text in standard Winforms listview control?

解决方案

If you want multi-line text in a ListView, have a look at ObjectListView (an open source wrapper around .NET WinForms ListView). This takes care of many of the problems involved with owner drawing (and other ListView annoyances).

In the following screenshot, the first column has WordWrap turned on:

Just remember that a ListView CANNOT have rows of different heights. In the above screenshot, I cannot make the first and third rows taller to show more text and the other rows shorter. Every row has to be the same height.

If being able to have rows of different heights is essential to you, a ListView will not your solution. You may want to consider Matthew Hall’s excellent XPTable and its update project, as well as Lee Paul Alexander’s fantastic Outlook-style list.

这篇关于WinForms ListView 控件上的多行列表项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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