|
-
May 27th, 2001, 04:12 PM
#1
Thread Starter
Fanatic Member
easy one Again!
I hate this! In a combo box... I havent found the correct event for when you change the selected item.
Onchange will only be executed if you type.
Onlostfocus... will only be executed, of course, when the focus has been lost.
But I have seen programs that react to the action of just selecting another item from the list.
Thank you!
-
May 27th, 2001, 04:13 PM
#2
Use the Click event!
Best regards
-
May 27th, 2001, 04:13 PM
#3
I believe it's the Click() event.
-
May 27th, 2001, 04:16 PM
#4
Thread Starter
Fanatic Member
No! I am sorry!
But the clic event is not executed when you select a different item. It is fired right when you clic the control...
-
May 27th, 2001, 04:18 PM
#5
Are you talking about the standard combo box that comes with VB?
The Click event in that one is only fired when you select a new item in the list.
-
May 27th, 2001, 04:19 PM
#6
It should work. Add this to a Form with a ComboBox.
Code:
Private Sub Combo1_Click()
MsgBox "You select: " & Combo1.Text
End Sub
Private Sub Form_Load()
For i = 0 To 10
Combo1.AddItem "Item" & i
Next i
End Sub
-
May 27th, 2001, 04:21 PM
#7
Thread Starter
Fanatic Member
OOOOOOOOPSSSSSSSSSSSS!!!!!!!!!!
You are right.......................
-
May 27th, 2001, 04:24 PM
#8
You should use both the Change() and Click() events.
Just using the example above.
Code:
Private Sub Combo1_Change()
Call Combo1_Click
End Sub
Private Sub Combo1_Click()
MsgBox "You select: " & Combo1.Text
End Sub
Private Sub Form_Load()
For i = 0 To 10
Combo1.AddItem "Item" & i
Next i
End Sub
-
May 27th, 2001, 04:45 PM
#9
Thread Starter
Fanatic Member
OK!
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
|