i have a form with many dynamic controls. i want to add an item to a listbox ( by the way, to find this listbox i'm using 'tag'. if someone have any other idea i'll be hope to hear but that's not the problem) in order to do so i use this code:
For Each ctl As Control In Me.Controls
If TypeOf ctl Is ListBox Then
ctl.items.add("i want to add this line")
' error massege
End If
Next
and items is not recognized and this eror massage apear:
'items' is not a member of 'System.Windows.Forms.Control'.
i use vb.net 2010
thank you very much
For Each ctl As Control In Me.Controls
If TypeOf ctl Is ListBox Then
ctl.items.add("i want to add this line")
' error massege
End If
Next
and items is not recognized and this eror massage apear:
'items' is not a member of 'System.Windows.Forms.Control'.
i use vb.net 2010
thank you very much