by JamesJD (11 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (8 Votes)
This simple little program will count the number of characters in a TextBox. Please leave your comments and votes, thanks :)
Inputs
One TextBox, one Label, and two CommandButtons. (You just need to keep their default names).
Code Returns
The number of characters entered into the TextBox.
Sub Clear()
Text1.Text = ""
Label1.Caption = "Characters: "
Text1.SetFocus
End Sub
Private Sub Command1_Click()
Label1.Caption = "Characters: " & Str$(Len(Text1.Text))
Text1.SetFocus
End Sub
Private Sub Command2_Click()
Call Clear
End Sub