|
-
Mar 14th, 2006, 10:36 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Combobox/optionbutton
Hey guys,
I want an combox that's enabled when you hit the optionbutton next to it, does anyone know a code for that? Thanks :-)
-
Mar 14th, 2006, 11:26 AM
#2
Hyperactive Member
Re: Combobox/optionbutton
 Originally Posted by Ermen
Hey guys,
I want an combox that's enabled when you hit the optionbutton next to it, does anyone know a code for that? Thanks :-)
use the click event of the optionbutton to enable the combobox next to it
-
Mar 14th, 2006, 11:36 AM
#3
Thread Starter
Addicted Member
Re: Combobox/optionbutton
I don't know how that's the problem :$
-
Mar 14th, 2006, 11:51 AM
#4
Re: Combobox/optionbutton
you need a Checkbox for that purpose because if you have only one option button then you cannot disable the combo again. try this:
VB Code:
Private Sub Form_Load()
Combo1.Enabled = False
End Sub
Private Sub Check1_Click()
If Check1.Value Then
Combo1.Enabled = True
Else
Combo1.Enabled = False
End If
End Sub
if you still want to use an option button, and you only have Option button and the combobox on your form, then put the option button within another container like PictureBox or Frame and in the above mentioned code, replace Check with Option.
Harsh Gupta.
-
Mar 14th, 2006, 11:52 AM
#5
Hyperactive Member
Re: Combobox/optionbutton
Private Sub Option1_Click()
Combo1.Enabled = True
End Sub
Also you would need to disable it if the user presses another optbutton
Private Sub Option2_Click()
Combo1.Enabled = False
End Sub
-
Mar 14th, 2006, 12:46 PM
#6
Re: Combobox/optionbutton
Harsh
Can't your code be simplifed to the following?
VB Code:
Private Sub Check1_Click()
Combo1.Enabled = Check1.Value
End Sub
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Mar 14th, 2006, 01:06 PM
#7
Thread Starter
Addicted Member
Re: Combobox/optionbutton
Thanks, the last post works..
-
Mar 14th, 2006, 02:36 PM
#8
Re: Combobox/optionbutton
 Originally Posted by DKenny
Harsh
Can't your code be simplifed to the following?
VB Code:
Private Sub Check1_Click()
Combo1.Enabled = Check1.Value
End Sub
:slaps forhead: knew doing something extra.
thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|