devxlogo

Restrict a Textbox to Accept Only Numbers

Restrict a Textbox to Accept Only Numbers

Sometimes we may need to restrict users from entering anything besides numbers in a textbox. The following code can achieve this:

 Option ExplicitPrivate strClipboardText As StringPrivate Sub txtNumberBox_KeyPress(KeyAscii As Integer)    If (KeyAscii <= Asc(

devx-admin

Share the Post: