(Reading time: 1 minute)

VB .NET

We can use isnumeric() to find out whether the text in a textbox contains only numbers.

Here is an example:

If IsNumeric(TextBox2.Text) Then
'Logic if the textbox has only numbers Else
'Logic if the textbox contains alphabets or special characters also
 
End If

 

Oxygen
Author: Oxygen
Other articles by this author

Chillzee Tag Cloud

Let's Socialize

About Chillzee

Chillzee.com is an entrepreneurship portal.

The site provides informative topics on Organizational and Strategic needs.