Hi VAer,
>How to exclude dot key?
You need to remove the && ch != 8 && ch != 46
, the IsLetterOrDigit
has indicates whether a character is categorized as a letter or a decimal digit.
>I would like to move the code to a bool statement public static bool isTextboxOnlyNumberOrLetter(), which will be called by many textbox from multiple forms. How to write the bool statement? How to call it?
- create a class into your project, like this:
- call it in the form you want:
Best Regards,
Dylan
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our **documentation to enable e-mail notifications if you want to receive the related email notification for this thread.**