Multi-line list items on WinForms ListView control?

后端 未结 2 1020
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-06 10:23

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

相关标签:
2条回答
  • 2020-12-06 11:14

    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.

    0 讨论(0)
  • 2020-12-06 11:16

    Yes, but only in a owner-drawn listview.

    EDIT

    Check these links:

    http://www.codeproject.com/KB/list/aa_listview.aspx

    http://www.codeproject.com/Messages/2857480/Multiline-listview.aspx

    0 讨论(0)
提交回复
热议问题