How to programmatically Close/Hide a Popup menu?
Posted on 2015-01-15
How to programmatically close/hide a popup menu, in VB6?
For instance, when a menu is shown with PopupMenu mnuFloat, it closes when a user clicks on the menus or somewhere outside the menus. However, how to close it without the need for user to click on the menus or somewhere outside the menus, i.e. completely programmatically?
REMARK: Calling SetForegroundWindow MenuParentForm.hWnd, where the MenyParentForm is the form on which the menu resides, although would work, from certain reasons in my project, is not a best solution, and I need an alternative way to close the menu, using API presumably…
PS: just to mention, an approach such as mnuFloat.Visible=False, mnuFloatSubmenu1.Visible=False etc., does not work…