That should work. Are you sure you put this code in KeyDown / KeyUp and not KeyPress?

------------------
[email protected]
...
Every program can be reduced to one instruction which doesn't work.