Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hey guys, I am just wondering does anyone know how to close a dropdown list using the mouseleave event? I have looked for examples everywhere but with no luck. Thanks for your help.
Posted
Comments
Red Chocolate 12-Nov-12 6:00am    
close means it should not be visible or just disable?
frostcox 12-Nov-12 6:22am    
When you select the dropdown list it shows say 20 items, I want to close the list once the mouse leaves the list items. Cheers
Storxstar 12-Nov-12 8:22am    
I reckon your best bet would be to dynamically select something else on mouse leave of the dropdown. Thus setting the focus to something else. closing your dropdown.
frostcox 12-Nov-12 10:42am    
Yeah that makes sense, but surely there is an event on the dropdown that you could call to close it. Maybe im just being silly here, anyway thanks for your help.
aodennison 12-Nov-12 16:31pm    
comboBox1.DroppedDown = false;
does close the drop down list as you might expect.

The problem is that combo1_MouseLeave (event) does not fire when the mouse leaves, if the drop down is dropped. I also investigated MouseMouse. It also does not fire while the drop down is dropped.

I seem to remember having this problem in VB6. The drop down is managed by the system. This allows the drop down to drop outside the limits of the host window and on top of other applications, until it is closed, but means the application has little visibility into any events that happen while dropped down.

1 solution

This solution might Help
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900