日期:2014-05-18 浏览次数:20751 次
string[] listArr = new string[] { user, name, pass, smsUState, smsContent, tmpAllToMob.ToString(), sender_name }; ListViewItem listLV = new ListViewItem(listArr); listLV.Tag = Convert.ToInt32(dr["Id"]); toplist.Items.Add(listLV);
private void button1_Click(object sender, EventArgs e) { string myid = toplist.SelectedItems[0].Tag.ToString(); MessageBox.Show(myid); }
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < 3; i++) { string[] listArr = new string[] { "user", "name" }; ListViewItem listLV = new ListViewItem(listArr); listLV.Tag = i; this.listView1.Items.Add(listLV); } } private void button2_Click(object sender, EventArgs e) { for (int i = 0; i < this.listView1.SelectedItems.Count; i++) { string myid = this.listView1.SelectedItems[i].Tag.ToString(); } }