CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2003
    Location
    Holland
    Posts
    146

    [RESOLVED] Menu rolled out by opening form

    Hello,
    I have on a form a menu with 6 sub items.
    When i load the form i want the menu rolled out automaticly.
    How can i do that?
    I want to see by opening the form:
    Main Menu
    sub item 1
    sub item 2
    etc.

    Thanks
    Herman

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Menu rolled out by opening form

    Depending on your menu a sendkeys should do the trick.

    For example lets say I have a menu with a caption of &Utilities
    I can use the following at the end of my form load event to cause this menu to drop down initially.
    Code:
    SendKeys "%" + "U"
    In this case U is the underlined character the % is the ALT key so the effect is the same as if the user pressed ALT+U
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Feb 2003
    Location
    Holland
    Posts
    146

    Re: Menu rolled out by opening form

    Thanks DataMiser, but is does not work here.

  4. #4
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Menu rolled out by opening form

    You did not give much to go on. If you used that line of code unchanged I would not expect it to work. Nor would it work if you have not used the & as part of your menu caption.

    Do you have a character underlined on the menu caption? Did you use that character in the place where I used a U in the example?
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Feb 2003
    Location
    Holland
    Posts
    146

    Re: Menu rolled out by opening form

    Sorry DataMiser,
    I quess i did not wake up properly this morning.
    I left the U instead of the correct letter.
    Now it works fine.
    Thanks a lot.
    Have a nice weekend.
    Herman

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

Featured