Wrap items in a windows applications List View control
Is there a way to make long items wrap in a .net windows forms application, 开发者_如何学GoI have already got LabelWrap set to true, but it doesn't work, I am using Details View Type,
Thanks
ListView doesn't allow text-wrapping.
What I usually do is set "ShowItemToolTips" property true in such cases. Then user can see the whole text a ToolTip. This is the only simple option I can see with ListView to help in this case.
If you really want to support for text-wrapping you will have to either use a third party ListView or use a DataGridView.
EDIT If you are using VS2010, Tile View is an option for you.
With the tile view feature of the ListView control, you can provide a visual balance between graphical and textual information. The textual information displayed for an item in tile view is the same as the column information defined for details view. Tile view works in combination with either the grouping or insertion mark features in the ListView control.
The LabelWrap property only works for icons (View types of LargeIcon or SmallIcon), not Details. As others have already answered, you have to use DataGridView or a 3rd party listview such as ObjectListView.
精彩评论