G
Geoff Cox
Hello,
I am starting to play around with drop down menus using comboboxes.
The code below works in that when the mouse moves over the image
behind the combobox, the box is populated with the various options.
A couple of questions.
Is it possible to bring the focus back to the slide once the correct
answer has been selected?
How do I ensure that the box is empty when the presentation is run? At
the moment sometimes it is empty, sometimes there is a 0 or 1 in the
box.
Thanks
Geoff
PS any source of help in using comboboxes? Books or the net?
Private Sub Initialize()
If ComboBox1.ListCount = 4 Then GoTo Check
ComboBox1.AddItem "Select"
ComboBox1.AddItem "Red"
ComboBox1.AddItem "Green"
ComboBox1.AddItem "Blue"
Check:
ComboBox1.Style = fmStyleDropDownList
ComboBox1.BoundColumn = 0
ComboBox1.ListIndex = 0
End Sub
Private Sub ComboBox1_Click()
Select Case ComboBox1.Value
Case 0
Label1.Caption = "What's your Answer?"
Case 1
Label1.Caption = "No, try again."
Case 2
Label1.Caption = "No, try again."
Case 3
Label1.Caption = "Well done, this is the correct answer."
End Select
End Sub
Sub object_mouse_over()
Initialize
End Sub
I am starting to play around with drop down menus using comboboxes.
The code below works in that when the mouse moves over the image
behind the combobox, the box is populated with the various options.
A couple of questions.
Is it possible to bring the focus back to the slide once the correct
answer has been selected?
How do I ensure that the box is empty when the presentation is run? At
the moment sometimes it is empty, sometimes there is a 0 or 1 in the
box.
Thanks
Geoff
PS any source of help in using comboboxes? Books or the net?
Private Sub Initialize()
If ComboBox1.ListCount = 4 Then GoTo Check
ComboBox1.AddItem "Select"
ComboBox1.AddItem "Red"
ComboBox1.AddItem "Green"
ComboBox1.AddItem "Blue"
Check:
ComboBox1.Style = fmStyleDropDownList
ComboBox1.BoundColumn = 0
ComboBox1.ListIndex = 0
End Sub
Private Sub ComboBox1_Click()
Select Case ComboBox1.Value
Case 0
Label1.Caption = "What's your Answer?"
Case 1
Label1.Caption = "No, try again."
Case 2
Label1.Caption = "No, try again."
Case 3
Label1.Caption = "Well done, this is the correct answer."
End Select
End Sub
Sub object_mouse_over()
Initialize
End Sub