C# 列表框新行 [英] C# list box new lines

查看:27
本文介绍了C# 列表框新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以 windows 形式在列表框中打印新行,但/n 或/r/n 无法在不同的行中打印.它全部打印为单个元素

I am trying to print new lines on a list box in windows form, but /n or /r/n is not working to print in different lines. It all prints as a single element

推荐答案

.NET windows 窗体标准列表框不支持多行项目.

.NET windows forms standard listbox does not support multi line items.

要获得您所描述的内容,您可以使用其他控件或自定义 ListBox 以使其工作方式不同.

to get what you describe you either use another control or customize the ListBox to work differently.

查看此链接:用于 .NET 的可编辑多行列表框 举例

也看看另一个,仍然是关于使用所有者绘制方法扩展控件:所有者绘制的控件 - 可扩展列表框

also have a look at this other one, still about extending controls with Owner Drawn approach: Owner Drawn Controls - Extendable ListBox

这篇关于C# 列表框新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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