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:
- This tutorial is a continuation of Allowing Numbers only in Textbox Using VB.Net.
- 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.
- 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
- TextBox1.Text = rep
- End Sub
- After that, Click F5 to run the program.
- After clicking the button:
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:
- How to Create an AutoComplete in a TextBox in VB.Net
- How to Determine the Size of the Textbox Using ForEach Loop in VB.Net