I've made a form that shows a variable number of instances of a usercontrol depending of a number from a database. Every usercontrol has a checkbox, but how do i know which one is selected if they all have the same name?
VB.NET - How to i identify one of multiple usercontrol instances?
Collapse
X
-
you can assign index number in some pattern to the controls
e.g
chk_0
chk_1
chk_2
chk_3
Thanx
Originally posted by JocaI've made a form that shows a variable number of instances of a usercontrol depending of a number from a database. Every usercontrol has a checkbox, but how do i know which one is selected if they all have the same name? -
Code:void AddControl(int index, Panel container) { CheckBox cb = new CheckBox(); cb.Name = "chk_"+index; container.Controls.Add(cb); }
Originally posted by JocaThanks for the quick reply. You mean using that "identifier " in the tag property of the control? I'll give it a shot. Thanks again.Comment
Comment