Results 1 to 3 of 3

Thread: set focus to a menu

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Location
    i live where you don't
    Posts
    76

    set focus to a menu

    anyone know how to set focus to a menu? i'm making an app with a system tray menu. it works fine, except you can't control it using the arrow keys of the keyboard unless you right click it first (set focus to it). i've set the parent form as the active window. without that, you can't scroll with the arrow keys even when you do right click.

  2. #2
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Try this:
    VB Code:
    1. Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
    2.  
    3. SetForegroundWindow Me.hwnd
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Location
    i live where you don't
    Posts
    76
    i've already tried that, along with SetActiveWindow. it sets the focus to the form, but not the menu itself.

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