|
-
Aug 18th, 2005, 04:09 AM
#1
Thread Starter
New Member
[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.
-
Aug 18th, 2005, 04:29 AM
#2
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.
-
Aug 18th, 2005, 04:34 AM
#3
Addicted Member
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
-
Aug 18th, 2005, 04:44 AM
#4
Re: noob stupid easy thing.......AGRH not enough coffee
 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.
-
Aug 18th, 2005, 04:47 AM
#5
Thread Starter
New Member
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
-
Aug 18th, 2005, 04:49 AM
#6
Re: [RESOLVED] noob stupid easy thing.......AGRH not enough coffee
Here's another article of interest.
-
Aug 30th, 2005, 01:08 AM
#7
Addicted Member
Re: [RESOLVED] noob stupid easy thing.......AGRH not enough coffee
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|