c# ProcessCmdKey overload, match generic combination

Posted by leo on Stack Overflow See other posts from Stack Overflow or by leo
Published on 2010-03-12T14:46:40Z Indexed on 2010/03/12 15:07 UTC
Read the original article Hit count: 145

Filed under:

Hi all,

On some control, I want ProcessCmdKey to return true if the keys pressed by the user were ALT and any letter of the alphabet.

I'm able to return true if the user presses Alt with the following code, but how can I add the condition of a letter also pressed ?

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
             if ((keyData & Keys.Alt) != 0) {
                  return true;
             }
}

Thanks.

© Stack Overflow or respective owner

Related posts about c#