We need to use the CTRL + E shortcut assigned to a menu item. We have a control that inherits the WinCombo. When the control has focus and the shortcut is executed nothing happens. The same issue existed with TextBoxes.
After searching I found:Ctrl-E not working in a read only text box?
"It is pretty bizarre but there's code in TextBoxBase that explicitly filters Ctrl+E, K, L and R when the text box's ReadOnly property is set to true."
Workaround:
using System; using System.Windows.Forms; public class MyTextBox : TextBox { protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { return false; } }
Using the workaround I can add code to the KeyDown event of the form then I can capture the Control + E; but, for the WinCombo I catch only the Control key and the E is eaten:
Debug.Print(oActiveCtl.Name & " >> " & e.Modifiers.ToString & " - " & e.KeyCode.ToString)
Text Box:txtClientName >> Control - ControlKeytxtClientName >> Control - E
WinCombo:cboClientCode >> Control - ControlKeyThe E is not passed back to the form.
Does the issue stated in the URL above affect any other Infragistics controls? Is there a workaround?
I changed the code to KeyUp and now the form is capturing the CTRL+E combination on the form's KeyUp event.