Combo: Execute vs Clicked vs KeyDown |
Post Reply |
Author | |
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
Posted: 27 October 2004 at 2:33am |
Gday,
How can I differ between when a user has pressed enter and when they have clicked on the combobox? They both trigger the Execute event, and I can't see how I determine the user's action. Normally in VB you would use the "Click" and KeyPress/Down events. How can I do this with the CommandBarComboBox? The desired effect is that when someone presses enter on the combo, i do a lookup based on the control.text, whereas when they "click" on the combo i don't need to a lookup beacuse the item they have clicked on already exists. Any advice is appreciated. Thanks |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
The InitCommandsPopup event is fired when the combobox is dropped down
(the dop-down button is clicked). Then the Execute event is fired
when they click\hit enter on a selection.
|
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
That helps, thanks.
I notice that this event passes a XtremeCommandBars.ICommandBar object. Is there a way to determine from this what triggered the event? For example, as well as triggering when the combo is dropped-down, it is also triggered when a popup menu is shown. I'm only interested in when the combo is dropped down. Its not essential, but would be helpful to know. Thanks again. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
CommandBar.Position = xtpBarListBox for combo list.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
This event is fired any time a drop-down/popup is displayed. In
the event you must test to see what triggered the event so you can act
on it appropriately. All you really need to do is look at the
Parent property.
If (Not CommandBar.Parent Is Nothing) And (CommandBar.Parent.Type = xtpControlComboBox) Then Dim myCombo As CommandBarComboBox Set myCombo = CommandBar.Parent.Id 'Your combobox code here End If |
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
Thanks oleg and SuperMario. I wasn't aware that CommandBar.Parent pointed to the control that triggered the event, that is helpful.
Remember though that VB6's If isnt short-circuited so If (Not CommandBar.Parent Is Nothing) And (CommandBar.Parent.Type = xtpControlComboBox) Then should be split to two ifs. Curse those stupid VB6 quirks! :) Thanks again. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |