OK, here is how I did it:
if ( ( ( e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z ) ||
( e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9 ) ||
( e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9 ) )
However that works on the assumption than Keys enumeration of A-Z and 0-9
are in the continuous range, which makes sense but is not spelled out
anywhere...
"panpawel" wrote:
Thanks, but to do that I need to get the Char pressed. The pressed key is an
enumerated type Keys (from KeyEventArgs). I could not find a method to
convert it to Char.
Help, please...
"Robson Siqueira" wrote:
Why don't you convert the pressed key into ASCII representation and then
verify if it matches?
--
Regards,
Robson Siqueira
Enterprise Architect
"panpawel" <pa******@discussions.microsoft.comwrote in message
news:5F**********************************@microsof t.com...
Is there a way to quickly determine if the key pressed was from 'A'-'Z' or
'0'-'9' range?
>
I really don't like to write switch with every Keys.A, Keys.B, etc key
listed
>
Paul