RE: KeyEventArgs by MortenWennevik
MortenWennevik
Tue Feb 12 10:35:03 CST 2008
"Arne Garvander" wrote:
> How do I cancel a key?
> --
> Arne Garvander
> Certified Geek
> Professional Data Dude
>
If you set KeyPressEventArgs.Handled = true in a TextBox.KeyPress event that
character won't reach the Text property. That way you can implement numeric
only textboxes and and similar. Similarly, if the Form's KeyPress event
'handles' a character, the child control won't get the KeyPress event.
As for keys handled by the child and not reaching the parent, I'm not sure
how that is implemented, only that the documentations state that this is
possible.
--
Happy Coding!
Morten Wennevik [C# MVP]