473,324 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Multiple hot key selection

I have a ContextMenu that begs to have hot keys. I tried adding some but am
having issues understanding how to properly manage the events when dealing
with more than one key pressed (e.g., Alt-F1, Cntr-C) or even with F2. Can
someone point me to some documentation that explains how to properly handle
these type of keyboard inputs in ContextMenus?
--
Steve
Nov 16 '05 #1
1 2423
If you are using the MenuItem controls, there is a "shortcut" property that
will take just about anything and trigger selection of that menu item. If
you set it through VS Properties box, you can just select from a list.
Otherwise, there is an enum called "Shortcut" that you can use for this (in
System.Windows.Forms, I think.)

If you want to handle everything manually, you'd probably need to use the
ProcessCmdKey(). Code inside would look something like this:

switch (keyData)
{
case Keys.F3:
HandleF3Press();
return true;
case Keys.Control | Keys.Up
HandleCtrlUpArrow();
return true;
case Keys.Alt | Keys.D1:
HandleAltOne();
return true;
default:
return base.ProcessCmdKey(ref msg, keyData);
}
"Steve Teeples" <St**********@discussions.microsoft.com> wrote in message
news:78**********************************@microsof t.com...
I have a ContextMenu that begs to have hot keys. I tried adding some but am having issues understanding how to properly manage the events when dealing
with more than one key pressed (e.g., Alt-F1, Cntr-C) or even with F2. Can someone point me to some documentation that explains how to properly handle these type of keyboard inputs in ContextMenus?
--
Steve

Nov 16 '05 #2

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

Similar topics

3
by: Lori Costache | last post by:
Hi guys, I have a problem with multiple selection I have a list with 8 options in pull-down menu. For each option I have a price. Something like that :Element Price Table 10 Sofa ...
2
by: DK | last post by:
Hello everybody ! I need little help from Your side. I have form called Form2, and ListBox called List 20. Property of List 20 allow multiple selection. Also I have query called Distribution as...
2
by: Jensen bredal | last post by:
Hello, Can someone guide me in how i may process a multiple selection on a databound checkboxlist? The checkboxlist is bound to a table of product category. The product category id is an FK in...
1
by: Brent Baker | last post by:
Is there a way to change a CListBox from single selection to multiple selection, or back again, from inside the program after the CListBox has been created? Our application has several...
1
by: Michael Groeger | last post by:
Hi, I want to be able to have a DropDownList which supports multiple selection, but I haven't found a property for that in the DropDownList control. Is there a way to have multiple selection...
1
by: Eddy Balan | last post by:
Hi. Please help me....... I would like to copy the datagrid contents to clipboard and then to paste it into Excel but I can't make a multiple selection. Eddy
10
by: ads | last post by:
hi, after binding the dropdownlist to a datasource, ive experience this error "Cannot have multiple items selected in a dropdownlist" after using the code:...
2
by: ggk517 | last post by:
I have a script like below: ------------------------------------------------------------------------------------------------------------------------ <html> <head> <title>TEST</title> <script...
4
by: bansh | last post by:
Hi all, As question title I need a javascript which provides the facility to make multiple selection without holding control key. Means I how is it possible to make multiple selection/deselction...
1
by: shidram | last post by:
Hello sir, I have problem while using javascript with HTML multiple selection tag, I want to write javascript in such a way that if a I change the option by clicking on the radio button on html...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.