多列列表框列表

2023-09-06 10:05:50 作者:恨透了谎言

有没有一种方法,以一个泛型列表绑定到一个多列列表框,列表框是...我知道,但是这是我坚持并不能添加一个网格或列表视图。

Is there a way to bind a Generic List to a multicolumn listbox, yes listbox...I know but this is what I am stuck with and can't add a grid or listview.

感谢

推荐答案

您可以列表绑定到这样一个列表框:

You could bind a list to a listbox like this:

List<int> list = new List<int> { 1, 2, 4, 8, 16 };
listBox1.DataSource = list;

对于多列列表框文件说列表框。多列中只需要进行垂直滚动不必要的物品放置到尽可能多的列。

As for multicolumn listbox documentation says ListBox.MultiColumn only places items into as many columns as are needed to make vertical scrolling unnecessary.

如果你想显示的信息,其中一整行会都被选择,你可以使用的多列列表框通过克里斯·里卡德。

If you want to show several columns of information for which an entire row will get selected you could use Multi Column List Box by Chris Rickard.