我對C#中的Listview有一些疑問,我的listview包含2列,如下所示:colDATA1 colDATA2 Value1 Amount1 Value2 Amount2 Value3 Amount3 Value4 Amount4我想做的是Amount5在Listview中搜索如果不存在,請執行一些操作。如果存在,則返回Value5我正在嘗試搜索和使用像這樣的代碼:If (Listview1.items.containskey("Amount5")){}else{MessageBox.show("Not Found")}or if exist then return the value5 *I have no idea how to do.我在谷歌搜索此,但大多數都只有1列,當我使用代碼時,代碼將無法工作。My question is : 1. How can I get Value5 if Amount5 exist.謝謝你。添加項目的代碼First Set listView1 Property "View : Details" Then Using this codethis.Listview1.Items.Add(new ListViewItem(new string[] { Value1, Amount1 }));
- 1 回答
- 0 關注
- 173 瀏覽
添加回答
舉報
0/150
提交
取消