Link to home
Start Free TrialLog in
Avatar of systems_ax
systems_ax

asked on

combo boxes in visual basic 2005

I have 2 radio buttons with its own combo boxes on my window's form.  How do I disable the combo box of a radio button number 1 when radio button number two is selected?
thank you
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium 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
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged

if radiobutton2.checked = 1 or true then
   combo1.enabled  = false

elseif radiobutton2.checked = 0 orfalse  then
combo1.enabled  = true
endif

End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged

if radiobutton1.checked = true then
   combo1.enabled  = true
   combo2.enabled  = false  
end if

End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged

if radiobutton2.checked =  true then
   combo1.enabled  = false
   combo2.enabled  =  true
end if

End Sub
Avatar of systems_ax
systems_ax

ASKER

Dhaest:,
thank you,works like a charm.