How do close a popup menu without clicking on a menu item?
I have a popupmenu appear when you click on an icon in the system tray. I want it to disappear when you click outside of the popupmenu object.
Any ideas?
Printable View
How do close a popup menu without clicking on a menu item?
I have a popupmenu appear when you click on an icon in the system tray. I want it to disappear when you click outside of the popupmenu object.
Any ideas?
Hmmm...I thought it automtically closes when you clicked outside of the menu...The Escape key closes open menus...maybe you could use the SendKeys function to send an Escape key code sequence?
Actually the Escape doesn't work either.
I wound up just ignoring it LOL! :)
i could not figure out what to do..sooo....
but i wonder if somehow you could get the current window with focus (mybe a timer) and if its not yours then....
?? maybe?
Use the SetForegroundWindow API function.
Code:Private Declare Function SetForegroundWindow _
Lib "user32.dll" (ByVal hwnd As Long) As Long
SetForegroundWindow Me.hWnd