我创建了一个复选框列表,并已将数据源附加到该列表中.我想从复选框列表中选中复选框 [英] i have created a checkboxlist and i have attached a datasource to it. i want to check the checkboxs from yhe checkboxlist

查看:54
本文介绍了我创建了一个复选框列表,并已将数据源附加到该列表中.我想从复选框列表中选中复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

For a As Integer = 1 To 6
    For i As Integer = 0 To itemCount - 1
          checkboxlist1.SelectedIndex = (seq_no(a) - 1).ToString              
    Next i
Next a


这里我有一个名为seq_no的数组,它包含先前存储在数据库中的checkboxlist1的选定索引值,而itemCount是checkboxlist1中的项总数.

现在我要使用该数组并在该checkboxlist1中选中multipul复选框

plz hlep me


here i have a array named seq_no it contains the selected index values of checkboxlist1 stored earlier in DB and itemCount is the total no.of items in checkboxlist1

now i Want to use that array and check multipul checkboxs in that checkboxlist1

plz hlep me

推荐答案

您的问题尚不完全清楚,但我想此链接可能会对您有所帮助.

http://social.msdn.microsoft.com /forums/zh-CN/winforms/thread/ce7c186c-b3f8-451d-8b13-037fed15716b/ [
Your question is not completely clear but I guess this link might help you out.

http://social.msdn.microsoft.com/forums/en-US/winforms/thread/ce7c186c-b3f8-451d-8b13-037fed15716b/[^]


By the way, the selectedIndex is probably not the property you should use. This will simply select a single list item (making it blue), but won''t check the item. You should use the checkedItems to do that.

Also, what is the inner loop about (For i As Integer = 0 To itemCount - 1) because you aren''t using that variable at all.

Good luck!


这篇关于我创建了一个复选框列表,并已将数据源附加到该列表中.我想从复选框列表中选中复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆