Link to home
Start Free TrialLog in
Avatar of humberss
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?


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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of humberss
humberss

ASKER

thanks for your quick response

Rod