I have a textbox in a form and I want to ensure that only upper case alphabets are entered into it, i.e. A..Z. No other characters are allowed. How to do I ensure it in Visual C Sharp using the Keypress event, e.g.
if(e.KeyChar ... && e.KeyChar) <---- Not sure what to put here
e.Handled = true;
I thought of using the range of Ascii values of A to Z, i.e. 65 to Z 91 to do this, but am not sure how to obtain the Ascii value in Visual C#.