Results 1 to 5 of 5

Thread: Closing PopUp Menus w/out clicking a menu item?

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    Chicago
    Posts
    40

    Question

    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?

  2. #2
    Addicted Member Babbalouie's Avatar
    Join Date
    Jan 2001
    Location
    On the bright, blue sea...
    Posts
    197
    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?
    Building A Better Body Albeit Left Out Under Intense Extrapolation

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    Chicago
    Posts
    40
    Actually the Escape doesn't work either.

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    i had the same problem..!

    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?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5
    Guest
    Use the SetForegroundWindow API function.


    Code:
    Private Declare Function SetForegroundWindow _
    Lib "user32.dll" (ByVal hwnd As Long) As Long 
    
    
    SetForegroundWindow Me.hWnd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width