Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1470
CTRL + E ignored (eaten) when control is read only.
posted

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 - ControlKey
txtClientName >> Control - E

WinCombo:
cboClientCode >> Control - ControlKey
The 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?