R
rsine
I am trying to understand exactly what the handle property of the
KeyPressEventsArgs does. I thought I could set it to false to prevent
a key from being included into a textbox. For example, if I wanted
only numbers in my textbox and the user pressed an alpha character key,
then I would set the handle property to false and it would be as if the
KeyPress event never occurred thus negating the keystroke. However,
what I am seeing is the pressed key still ends up in my textbox. I
read on MSDN that if the handle is set to false, the operating system
uses a default process to handle the event which is what I figure is
putting the keystroke into the textbox. Is this true or am I
misreading what happens? If it is true, what does setting the handle
property to false actually do?
-Thanks
KeyPressEventsArgs does. I thought I could set it to false to prevent
a key from being included into a textbox. For example, if I wanted
only numbers in my textbox and the user pressed an alpha character key,
then I would set the handle property to false and it would be as if the
KeyPress event never occurred thus negating the keystroke. However,
what I am seeing is the pressed key still ends up in my textbox. I
read on MSDN that if the handle is set to false, the operating system
uses a default process to handle the event which is what I figure is
putting the keystroke into the textbox. Is this true or am I
misreading what happens? If it is true, what does setting the handle
property to false actually do?
-Thanks