VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A program to count the number of characters in a TextBox.

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.

Rate A program to count the number of characters in a 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

Download this snippet    Add to My Saved Code

A program to count the number of characters in a TextBox. Comments

No comments have been posted about A program to count the number of characters in a TextBox.. Why not be the first to post a comment about A program to count the number of characters in a TextBox..

Post your comment

Subject:
Message:
0/1000 characters