|
发表于 2013-6-5 23:18:15
|
显示全部楼层
非常感谢,弄明白了。先向第三列插入空值,然后就可以改内容了。。。
[code=csharp]private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < 20; i++)
{
ListViewItem lv = new ListViewItem();
int id = listView1.Items.Count + 1;
lv.SubItems[0].Text = id.ToString();
lv.SubItems.Add("username");
lv.SubItems.Add("password");
lv.SubItems.Add(string.Empty);
listView1.Items.Add(lv);
}
}
private void button1_Click(object sender, EventArgs e)
{
listView1.Items[0].SubItems[3].Text = "abc";
}[/code]
|
|