Windows Develop Bookmark and Share   
 index > Windows Forms General > how to override key events in ToolStrip.ComboBox (MSKLC keyboard )
 

how to override key events in ToolStrip.ComboBox (MSKLC keyboard )

Unexpected tabbing away from ToolStripComboBox input

I have a simple Windows form application with:

1) Form
2) MenuStrip
3) ToolStrip
4) ToolStripComboBox
5) Textbox with MultiLine=True

My application requires an extended character set (unicode), i.e. special symbols above and beyond the standard ASCII set. They are entered using a special keyboard created using the Microsoft keyboard creation utility- MSKLC V1.4. As such the Ctrl-Key is a mode key just like the Shift-Key and yeilds my special characters. All of this works correctly for the Textbox.

Unfortunately the default action for keyboard entry in the ToolStripComboBox works less well. Several of the control key combinations result in no character printed and instead the focus shifts to the MenuStrip. If I press the same combination again, the focus shifts back to the ComboBox. The misbehaving keys are: ^Y ^I ^O ^] ^K ^M ^/.

Can anyone point me to some sample C# code which shows how to override this undesirable default behavior?

Thanks,
J. Goff

comet270  Thursday, September 17, 2009 6:53 PM
Hello J. Goff,

> Can anyone point me to some sample C# code which shows how to override this undesirable default behavior?

You can handle the KeyDown event of ToolStripComboBox to detect whether Modify key (e.g Ctrl key) is pressed. Then you can do some customize action to change default behavior.
For example,
void toolStripComboBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Modifiers == Keys.Control)
{
}
}

But it is unclear to me what is MSKLC V1.4 used for. Could you please explain it more clearly?

Sincerely,
Kira Qian

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Monday, September 21, 2009 10:03 AM
We are changing the issue type to “General Discussion�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by opening the Options list at the top of the post editor window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Thursday, September 24, 2009 9:56 AM

You can use google to search for other answers

Custom Search

More Threads

• Binding comboboxes to related tables !
• The best and fastest way of image processing ?
• Mixed application console/windows.forms??
• How to set cursor unfocus by pressing enter key without affecting submit bottom
• Hidden Form for DirectSound - How to Play a sound without a window/form ? (C#)
• CLI C++ cant see change in control while the program is running
• ListBox items should be gray when not in focus - why arent they?
• VB express & web service as data source
• How can I make the courser ready inside the list Box?
• creating a windows form with .net without the command window (console)