Results 1 to 3 of 3

Thread: Adding shortcuts

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Location
    Sas van Gent - Holland
    Posts
    23

    Adding shortcuts

    YO guys and girls.

    Does anyone have any id how to ad shortcuts to a program?
    I want to use more shortcuts than those in Menu Editor
    Life is too short.
    Live your life.

    And:
    Believe in god, but dont forget to believe in yourself.

  2. #2
    Frenzied Member JungleMan's Avatar
    Join Date
    Feb 2001
    Posts
    2,033
    Do you want to add shortcuts to the start menu?

    Or do you want to launch an outside program from your program?
    I'm bringing geeky back...

  3. #3
    Frenzied Member
    Join Date
    Aug 2001
    Posts
    1,075
    You can add other shortcuts to menus by first adding the shortcut text to the menu Caption property preceeded with a Tab. Then set the Forms KeyPreview property to Ture so you can intercept the keyboard activity. Then trap for the key in the Form_KeyPress event...

    VB Code:
    1. Private Sub Form_Load()
    2.     Me.KeyPreview = True
    3.     'Make the SpaceBar a shortcut
    4.     mnuTest.Caption = "Test" & vbTab & "SpaceBar"
    5. End Sub
    6.  
    7. Private Sub Form_KeyPress(KeyAscii As Integer)
    8.     'Trap for the spacebar
    9.     If KeyAscii = vbKeySpace Then
    10.         MsgBox "Space bar pressed"
    11.     End If
    12. End Sub

    Greg
    Free VB Add-In - The Reference Librarian
    Click Here for screen shot and download link.

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