Removing Numbers in Textbox using VB.Net

0
1492

This tutorial is all about Removing Numbers in Textbox using VB.Net With this tutorial about Removing Numbers in Textbox using VB.Net which we can clear number in the textbox. So let’s get started:

 

  • So let’s design our form like this one just like what I’ve shown you below
    Select a Textbox, Button and label from the toolbox.
  • After that,Add this code to the Button.
    [vbnet] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim rep As String = String.Empty
    For i As Integer = 0 To TextBox1.Text.Length – 1
    If Not IsNumeric(TextBox1.Text.Substring(i, 1)) Then
    rep += TextBox1.Text.Substring(i, 1)
    End If
    Next
    TextBox1.Text = rep
    End Sub
    [/vbnet]
  • After that, Click F5 to run the program.
    Output:
  • After clicking the button:
    Output:

If you have any comments or suggestions about on Removing Numbers in Textbox using VB.Net Please feel free to contact our webpage.

Download Removing Numbers in Textbox using VB.Net Code here

 

 

Readers might read also:

Looking for more source code? Type your keyword here here!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.