我是有点,我看了一下ListView的一些教程相混淆。
I'm a bit confused by a few tutorials that I read about the ListView.
我有一个ListView控件和左侧应该是一个名称,该名称的权利应该是这样的,在它的一些更多的文本另一列。例如:
I have a ListView control and on the left hand side should be a name, and to the right of that name should be like another column with some more text in it. For example:
jason blah blah blah
item2 more blahs
item3 jupiter
item4 uranus
如何才能做到这一点?是否有这样做的一个简单的方法?
How can this be done? Is there a simple way of doing this?
感谢您
使用的列标头集合添加列,如
Use the Columns header collection to add the columns such as
在列#1 在列#2 在列#3然后使用一个ListViewItem的集合设置列的值,这个
then use the ListViewItem's collection to set the values of the columns such this
ListViewItem lvi = new ListViewItem("foo");
lvi.Add("bar");
lvi.Add("baz");
listview.Items.Add(lvi);
现在,您将有福,酒吧和巴兹分别在列列#1,列2和列#3分别。
Now, you will have "foo", "bar" and "baz" respectively under the columns "Column #1", "Column #2" and "Column #3" respectively.
您会发现列集合从属性工具框的列表视图中。请确保你设置视图类型详细信息看到这种效果。
You will find the Column collection from within the Properties tool box for the listview. Be sure you set the view type to 'Details' to see this effect.