Removing Numbers in Textbox using VB.Net

0
108

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.
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2. Dim rep As String = String.Empty
    3. For i As Integer = 0 To TextBox1.Text.Length - 1
    4. If Not IsNumeric(TextBox1.Text.Substring(i, 1)) Then
    5. rep += TextBox1.Text.Substring(i, 1)
    6. End If
    7. Next
    8. TextBox1.Text = rep
    9. End Sub
  • 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:

Facebook Comments
(Visited 122 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here