在checklistbox中创建检查项目的标签 [英] create lable of checked items in checklistbox
本文介绍了在checklistbox中创建检查项目的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Everyone,
i需要一个帮助,我想要的是有一个checklistbox我想创建一个在checkboxlist中检查过的项目我写了这个代码:
Hello Everyone ,
i need one help, what i want is that there is a checklistbox i want to create a lable of items checked in checkedboxlist i have writen this code :
Private Sub CreatControls()
If chkcolmlst.CheckedItems.Count > 0 Then
Dim lbl(100) As Label
For i As Integer = 0 To chkcolmlst.Items.Count - 1
lbl(i) = New Label()
newform.Controls.Add(lbl(i))
lbl(i).Text = chkcolmlst.Text
lbl(i).Location = New Point(125, 135 + (i * 200))
Next
End if
现在的问题是它正在创建一个标签,但它创建了一个同名的标签,我选择了checkedlistbox中的最后一项。
请帮助...............
now problem is that it is creating a lable but it is creating a lables of same name what i select the last item in checkedlistbox.
please help...............
推荐答案
一个相当简单的问题,你放了每个标签都有相同的文字:
A fairly simple issue, you put the same text into every label:
lbl(i).Text = chkcolmlst.Text
大概你真正想要的是从 i
的当前值索引的项目中的一些细节。
Presumably what you really want is some detail from the item indexed by the current value of i
.
这篇关于在checklistbox中创建检查项目的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文