Restrict Textbox Entries to Numeric-only

Category:
Forms and Controls
Type:
Snippets
Difficulty:
Beginning
Author:
Hosein Parnian

Version Compatibility: Visual Basic 6, Visual Basic 5, Visual Basic.NET

More information:
With this sub procedure, you can restrict textBox entries to numeric-only input, or trap non-numeric entries. Simply add a textBox named text1 to your form to test this method.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: