humberss
asked on
adding items to a listbox in a groupbox with radiobuttons vb 2008
Hi,
I have a groupbox containing 3 listbox and 3 radio buttons, Im trying to write a function to add items to all 3 listbox, but I keep getting errors like Conversion from type 'RadioButton' to type 'String' is not valid type errors, is there a way to specify which control on the groupbox I want to work with?
I have a groupbox containing 3 listbox and 3 radio buttons, Im trying to write a function to add items to all 3 listbox, but I keep getting errors like Conversion from type 'RadioButton' to type 'String' is not valid type errors, is there a way to specify which control on the groupbox I want to work with?
Function ListBoxDefault(ByVal intSelected As Integer) As Integer
For Each ctrl As ListBox In Me.GroupBox2.Controls
ctrl.Items.Add(CStr("wwwww"))
ctrl.Items.Add cstr("dddddd
Next
End Function
OR this
For Each listbox As String In Me.GroupBox2.Controls
listbox.Insert(0, "wwww")
Next
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Rod