Click here to Skip to main content
13,199,026 members (42,981 online)
Rate this:
Please Sign up or sign in to 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 11-Nov-12 23:11pm
Member 9562996 12-Nov-12 6:00am
close means it should not be visible or just disable?
Mickt1985 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.
Mickt1985 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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This solution might Help

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171020.1 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100