Multi-line list items on WinForms ListBox control?

2020-01-29 18:18发布

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条回答
爱情/是我丢掉的垃圾
2楼-- · 2020-01-29 18:51

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.

查看更多
登录 后发表回答