Multi-line list items on WinForms ListBox control?

一曲冷凌霜 提交于 2019-11-27 04:07:43

问题


I have some strings that contain line breaks, and I would like to keep this formatting in each ListBox item that the strings are applied to.

Is there any way to do this?

Thanks


回答1:


The ListBox in winforms doesn't support multiline/text wrapping. If you want that kind of behaviour you probably need to do a custom control or there may be a third party control.

There's a sample implementation at http://www.codeproject.com/articles/2695/an-editable-multi-line-listbox-for-net. It's old so there may be better implementations out there/at least you can see what's involved.



来源:https://stackoverflow.com/questions/9532368/multi-line-list-items-on-winforms-listbox-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!