Results 1 to 5 of 5

Thread: Key Combination...

  1. #1

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Thumbs up Key Combination...

    How can I attach Ctrl + W key to a command button...

    I mean when Ctrl + W key is pressed cmdWipeAll_Click event should occur...

    I am sure that its something to do with keypress event in FORM...

    Urgent...

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    Actually it's KeyDOWN you want, just check this:

    VB Code:
    1. If Shift = 2 AND (Ucase(Chr(KeyCode))="W") Then
    2.   'It's pressed!
    3. End If

    PS: "Urgent..." made me wait five minutes before reading your question

  3. #3

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Question OK...

    what does that SHIFT = 2 means...???

    Is it same with the CONTROL and ALT keys...???

    Can some one make it clear plz...???

    Cheers...

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Have you ever even heard of MSDN ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    Shift = 2 means that CTRL is pressed, Shift = 1 means Shift is pressed, and 4 means ALT is pressed.

    you can see help on "keydown" for more info if you need it

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