Invode method via Function Keys

  • Thread starter Thread starter Dennis C. Drumm
  • Start date Start date
D

Dennis C. Drumm

What is the best way for a modal dialog (windows form) to invoke an
unpublicized key combination such as CTRL-ALT-F6? Would it be to set a
single key up event for all the controls in the dialog to test for that
particular key combination or is there a better way to do it? What I don't
want to do is invoke the method with a button control or menu item click.
This is something I want to be un-publicized, if you will.

Thanks,

Dennis
 
Dennis C. Drumm said:
What is the best way for a modal dialog (windows form)
to invoke an unpublicized key combination such as CTRL
-ALT-F6? Would it be to set a single key up event for all
the controls in the dialog to test for that particular key
combination or is there a better way to do it?

Form.KeyPreview = true

This lets the form receive keystrokes before its controls do.

P.
 
Hi Dennis,

You can find the below remark of Form.KeyPriew property in MSDN:

"You can use this property to process all keystrokes in your application
and either handle the keystroke or call the appropriate control to handle
the keystroke. For example, when an application uses function keys, you
might want to process the keystrokes at the form level rather than writing
code for each control that might receive keystroke events."

Hope it helps.

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Reply-To: "Dennis C. Drumm" <[email protected]>
| From: "Dennis C. Drumm" <[email protected]>
| Subject: Invode method via Function Keys
| Date: Mon, 4 Aug 2003 07:32:40 -0400
| Lines: 12
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: tc-nhmht-swr-u189.net-resource.com 216.204.76.189
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:173959
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| What is the best way for a modal dialog (windows form) to invoke an
| unpublicized key combination such as CTRL-ALT-F6? Would it be to set a
| single key up event for all the controls in the dialog to test for that
| particular key combination or is there a better way to do it? What I don't
| want to do is invoke the method with a button control or menu item click.
| This is something I want to be un-publicized, if you will.
|
| Thanks,
|
| Dennis
|
|
|
 
Thnaks to both of you that responded. That was the property that I had
missed.

Dennis
 
Back
Top