聚化网网站,个人邮箱登录登录入口,网站开发需要哪些人员,seo公司中国在c#winform中怎样获取checklistbox选中的值 checkedListBox1.SelectedItem.ToString(); checkedListBox1.SelectedItems[0].ToString(); 这两种方式都可以#xff0c;不懂可以追问或HI聊#xff0c;但请不要关闭问题#xff0c;谢谢#xff01;在datagridview1_cellconten… 在c#winform中怎样获取checklistbox选中的值 checkedListBox1.SelectedItem.ToString(); checkedListBox1.SelectedItems[0].ToString(); 这两种方式都可以不懂可以追问或HI聊但请不要关闭问题谢谢在datagridview1_cellcontentclick事件中 datagridview1.currentrow//当前点击单元格的行 datagridview1.currentrow.cells[这里填第几列]//即当行的第几列 datagridview1.currentrow.cells[这里填第几列].value.tostring()//当前行的第几列的值。。 这样就好做了吧。。if (checkedListBox1.GetItemChecked(0))//判断是不是选中了某行 string strcheckedListBox1.SelectedItems[j].ToString(); 获取第j行内的内容for (int i 0; i checkedListBox1.CheckedItems.Count; i) { checkedListBox1.CheckedItems[i]; }For Each item As Object In checklistbox1.CheckedItems MsgBox(item.ToString) VB.NET 的写法 c# checklistbox 如何取选择的值例如:我选择了第1、3、5的选项如何获取它的值 /// /// C#中获取CheckListBox选中项的值。 /// /// 要被获取选中项的CheckListBox类型的对象。 /// 返回一个ArrayList类型的对象。 private ArrayList GetCheckedItemsText(CheckedListBox clb) { ArrayList result new ArrayList(); IEnumerator myEnumerator clb.CheckedIndices.GetEnumerator(); int index; while (myEnumerator.MoveNext()) { index (int)myEnumerator.Current; clb.SelectedItem clb.Items[index]; result.Add(clb.Text); } return result;} 或者 你可以使用遍历 for (int i 0; i checkedListBox1.Items.Count; i) if (checkedListBox1.GetItemChecked(i)) MessageBox.Show(checkedListBox1.GetItemText(checkedListBox1.Items[i])); //弹出选中值 }foreach (object i in checkedlistbox1.checkeditems) { messagebox.show(i.tostring()); }