Ivan I
Ivan I

Reputation: 9990

How to detect Alt + left key in ToolStripTextBox

In C# - WinForms, how to detect Alt + left key when it is pressed in ToolStripTextBox?

Upvotes: 2

Views: 776

Answers (1)

Hans Passant
Hans Passant

Reputation: 942438

    protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
        if (this.ActiveControl == toolStripTextBox1.Control && keyData == (Keys.Alt | Keys.Left)) {
            MessageBox.Show("it's special");
            return true;
        }
        return base.ProcessCmdKey(ref msg, keyData);
    }

Upvotes: 4

Related Questions