By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,326 Members | 881 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,326 IT Pros & Developers. It's quick & easy.

Event : ANYKEY

P: n/a
Hello,

I want a key press ( any key ) to be an EVENT in the currently active FORM

As I am new to VB the only EVENTs I have used have come from the list of
controls on the left hand side of Visual Studio. Where would I get the
ANYKEY code and where would I get the code for other such events that are
not show on the list of controls on the left hand side of Visual Studio ?

Thanks Dan
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* "Dan DeConinck" <pi********@sympatico.ca> scripsit:
I want a key press ( any key ) to be an EVENT in the currently active FORM

As I am new to VB the only EVENTs I have used have come from the list of
controls on the left hand side of Visual Studio. Where would I get the
ANYKEY code and where would I get the code for other such events that are
not show on the list of controls on the left hand side of Visual Studio ?


Why not set the form's 'KeyPreview' property to 'True' and add a handler
for the, for example, 'KeyDown' event?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
Your kidding right ?, the ANYKEY does not exists does it ( Homer Simpson ).

Assuming your serious for just one moment, do you mean any key press in
windows , on within the form your are referring to. If you are referring to
the form, then set the KeyPreview = True on your form and use the KeyDown,
KeyUp and KeyPress events to view any kepress on any control in that form.

Regards - OHM

Dan DeConinck wrote:
Hello,

I want a key press ( any key ) to be an EVENT in the currently active
FORM

As I am new to VB the only EVENTs I have used have come from the list
of controls on the left hand side of Visual Studio. Where would I get
the ANYKEY code and where would I get the code for other such events
that are not show on the list of controls on the left hand side of
Visual Studio ?

Thanks Dan


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.