Results 1 to 7 of 7

Thread: [RESOLVED] noob stupid easy thing.......AGRH not enough coffee

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    7

    Resolved [RESOLVED] noob stupid easy thing.......AGRH not enough coffee

    OK im sure ill get flamed for beig a noob but i have spent a hour searching for how to do this and im still not getting it...... if someone could explaine how to link a keystroke to an event? like if someone presses the key 1 the my.computer.audio.play (openfiledialog1.Filename) would play,

    excuse the bad english its late here
    Last edited by Dj Duz; Aug 18th, 2005 at 04:20 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: noob stupid easy thing.......AGRH not enough coffee

    Set the KeyPreview property of the form to True and then test for the desired key in an event handler for the form. The KeyPress event would be the preference, but if it is one of the less common keys that is not detected in the KeyPress event then you can use the KeyDown or KeyUp event instead.

    By the way, I won't flame you for being a noob, but I do have a preference for descriptive thread titles.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Re: noob stupid easy thing.......AGRH not enough coffee

    Would this only Work if the Form is in Focus? What if its Minimized? If it Wont Detect whats the Search Item for that Feature?
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: noob stupid easy thing.......AGRH not enough coffee

    Quote Originally Posted by Codehammer
    Would this only Work if the Form is in Focus? What if its Minimized? If it Wont Detect whats the Search Item for that Feature?
    Yes this will only work if the form has focus. If you want to detect keystrokes at other times too, take a look at this article by one of our fellow VBF members.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    7

    Re: noob stupid easy thing.......AGRH not enough coffee

    i love you





    j/k thanks a whole heap
    p.s if i ever run out of coffee watch for my discriptive title thingys

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] noob stupid easy thing.......AGRH not enough coffee

    Here's another article of interest.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Re: [RESOLVED] noob stupid easy thing.......AGRH not enough coffee

    *Now I Love Him
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

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