473,587 Members | 2,267 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invode method via Function Keys

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
Nov 15 '05 #1
3 3772
"Dennis C. Drumm" <de*******@prim acode.com> wrote:
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.

--
www.CL4.org
Nov 15 '05 #2

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" <de*******@prim acode.com>
| From: "Dennis C. Drumm" <de*******@prim acode.com>
| 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: <#P************ **@TK2MSFTNGP11 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: tc-nhmht-swr-u189.net-resource.com 216.204.76.189
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1739 59
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
|
|
|

Nov 15 '05 #3
Thnaks to both of you that responded. That was the property that I had
missed.

Dennis
"Jeffrey Tan[MSFT]" <v-*****@online.mi crosoft.com> wrote in message
news:r8******** *****@cpmsftngx a06.phx.gbl...

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" <de*******@prim acode.com>
| From: "Dennis C. Drumm" <de*******@prim acode.com>
| 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: <#P************ **@TK2MSFTNGP11 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: tc-nhmht-swr-u189.net-resource.com 216.204.76.189
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1739 59 | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
|
|
|

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2703
by: Phil Powell | last post by:
/*-------------------------------------------------------------------------------------------------------------------------------- Parameters: $formField1: The name of the first array $formField2: The name of the second array $formField1CompareWith: String to use as my comparison basis for first array. Defaults to using $val unless it's 'key'...
1
2828
by: Jim Heavey | last post by:
Hello, I am running into something strange. I am getting the following error when the program attempts to execute a particular procedure: An unhandled exception of type 'System.MissingMemberException' occurred in microsoft.visualbasic.dll Additional information: Public member 'FindSearchValueRecord' on type 'ProfileRecordProcessing' not...
12
6726
by: Rubbrecht Philippe | last post by:
Hi there, According to documentation I read the ArrayList.IndexOf method uses the Object.Equals method to loop through the items in its list and locate the first index of an item that returns True. Therefore, overriding the Equals method in the class definition of the items I put in the ArrayList should make the IndexOf method use my...
1
6833
by: Steve | last post by:
I would like to override the IsInputKey function in order to trap the arrow up/down keys in the Key Events. I understand that arrow keys don't have a char representation and thus, hard to trap. Someone wrote this override for IsInputKey in C# which apparently worked, and I tried to convert it to VB.Net but not working. Here is the C#...
6
2666
by: Mike | last post by:
Hi, I have such problem: On my form I have TabControl. I want to move from one tab to another using "Next" and "Prev" button. This part works fine. But control also supports switching between TabPagess using combination of buttons Ctrl+Tab (forward) and Ctrl+Shift+Tab (back). I would like to suppress such possibility.
3
5243
by: MLM450 | last post by:
I have a control that handles the KeyDown event but it does not seem to execute when a combination of keys is pressed - like CTRL+Z. If I press CTRL, it executes. If I press Z, it executes. But the handler does not see the combination. Now this control is contained within another control which is contained within another. The top most...
9
34719
by: Laphan | last post by:
Hi All I'm using the below to limit the input into a text box to just letters, numbers, hyphens and full stops, but I also need to allow the backspace, delete and arrow keys to come through. How can I do this? <script language="JavaScript" type="text/javascript"> <!-- function onKeyPressBlockNumbers(e) {
9
2391
by: Wingot | last post by:
Hey, I am using Visual Studio 2008 Beta 2 for some application development in C#, but I presume that the following question applies equally well to any environment.
2
1801
by: blaine | last post by:
Hey everyone, Just a friendly question about an efficient way to do this. I have a graph with nodes and edges (networkx is am amazing library, check it out!). I also have a lookup table with weights of each edge. So: weights = .12 weights = .53 weights = 1.23 weights = -2.34 etc.
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2347
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.