Results 1 to 3 of 3

Thread: BY default focus on menu.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Lightbulb BY default focus on menu.

    my form contains a menu.
    i want some code by which by default when main form is called it should set focus on my menu.
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  2. #2
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: BY default focus on menu.

    Use sendkeys.

    Sample: on the File menu make sure you put ampersand like &File. So when you triggered alt + F then it will pop up. Then sendkeys down until you reach a certain item on the menu.

    Code:
    Private Sub Form_Load()
       SendKeys "%{F}"
       SendKeys "{DOWN}"
    End Sub
    You can use SendKeys "{DOWN 5}" ' press down 5 times

    It's a cheap solution however.
    Last edited by zynder; Apr 20th, 2007 at 04:02 AM.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: BY default focus on menu.

    any other way rather than using sendkeys function.
    coz sometimes sendkeys not works.
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

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