lets take an example that:
first place an TextBox on windows form then on KeyDown event of textbox write code that is written or shown below:
|
greter than 0 or not and same like that NumPad9 cheking
like that Keys.Back cheking for Backspace is pressed or not and
like that shift key pressed or not and Decimal is pressed or
not same like that checking other keys pressed or not and which
you can press or you able to press
//
//
after IF statement and code is written that is e.SuppressKeyPress=true;
here e is object of key event handler and SuppressKeyPress is bool
type accept true/false value and indicate that key event should
be passed on underlying control.
True if the key event should not be sent to the control; otherwise,
false.
we assign true to SuppressKeyPress property in an event handler such as KeyDown
in order to prevent user input
Thanking you

Sherif HamdyPosted Dec 30, 2022, 12:38 AM
And "Keys.OemPeriod"