Menu Shortcut


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Menu Shortcut

  1. #1
    Fred Dalton Fred Guest

    Menu Shortcut


    I want to assign Alt+1, Alt+2 and Alt+3 to my form's menus, just like Windows
    Media Player. But VB's menu editor doesn't let me. Is there some API that
    will let me manually assign a short cut to a menu? If not, how does Windows
    Media Player do it? Thanks....

    - Fred Dalton

  2. #2
    Larry Rebich Guest

    Re: Menu Shortcut

    Fred,

    Code similar to this will work:

    Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKey1 And Shift = vbAltMask Then
    Caption = "Alt1 Pressed"
    End If
    End Sub

    Private Sub Form_Load()
    Me.KeyPreview = True
    End Sub

    Cheers,
    Larry Rebich

    More tips link to:
    http://www.buygold.net/tips.html

    Please:
    No personal e-mail questions :-)


    <Fred Dalton Fred> wrote in message news:3a0f669f$1@news.devx.com...
    >
    > I want to assign Alt+1, Alt+2 and Alt+3 to my form's menus, just like

    Windows
    > Media Player. But VB's menu editor doesn't let me. Is there some API that
    > will let me manually assign a short cut to a menu? If not, how does

    Windows
    > Media Player do it? Thanks....
    >
    > - Fred Dalton




  3. #3
    Larry Rebich Guest

    Re: Menu Shortcut

    Fred,

    Code similar to this will work:

    Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKey1 And Shift = vbAltMask Then
    Caption = "Alt1 Pressed"
    End If
    End Sub

    Private Sub Form_Load()
    Me.KeyPreview = True
    End Sub

    Cheers,
    Larry Rebich

    More tips link to:
    http://www.buygold.net/tips.html

    Please:
    No personal e-mail questions :-)


    <Fred Dalton Fred> wrote in message news:3a0f669f$1@news.devx.com...
    >
    > I want to assign Alt+1, Alt+2 and Alt+3 to my form's menus, just like

    Windows
    > Media Player. But VB's menu editor doesn't let me. Is there some API that
    > will let me manually assign a short cut to a menu? If not, how does

    Windows
    > Media Player do it? Thanks....
    >
    > - Fred Dalton




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center