C#: How to add subitems in ListView

后端 未结 10 1245
眼角桃花
眼角桃花 2020-11-29 07:33

Creating an item(Under the key) is easy,but how to add subitems(Value)?

listView1.Columns.Add(\"Key\");
listView1.Columns.Add(\"Value\");
listView1.Items.Add         


        
10条回答
  •  独厮守ぢ
    2020-11-29 08:02

    add:

    .SubItems.Add("asdasdasd");
    

    to the last line of your code so it will look like this in the end.

    listView1.Items.Add("sdasdasdasd").SubItems.Add("asdasdasd");
    

提交回复
热议问题