Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

click event on combo box!

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
Hi all,

Don't u think its a bit daft why the click event on the combo box ALSO executes when the data is changed through code using the listindex for example?

This should be for the change event dont u think?

There maybe a valid reason for this but its Monday for me and i can't see one :)

Mel s-)
 
The reason for it is probably that a combo box is actually two controls in one: a text box and a list box, but we see it as one control, so we only get the higher level events.

In other words setting the listindex property actually causes a click event in the listbox (which causes a change in the textbox), and that event bubbles up. So you get a click event (from the lisbox) and a change event (from the textbox)
 
If you want "CLICK" only, use MouseDown and /or MouseUP events. Trace ordinary click with debug.print. I forget if it occurs on Down Or UP. On button, it occurs on UP so you cam mousdown on a button but move the cursor away without getting a click on the button.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top