Search Tools Links Login

_String Auto Backspace_


With this extremely easy code, you can erase a character at the end of a string or in a textbox with a click of a button. Very easy code and every line is commented. DON'T forget to vote.

Original Author: Tomas Tupy

API Declarations

Dim backlength As Integer
Dim backString As String

Code

Dim backlength As Integer
'declare the variable in which the length will be stored
Dim backString As String
'declare the string in which Text1 wil be stored
Private Sub Command1_Click()
backlength = Len(Text1.Text)
'find the length of the text in the textbox
backString = Mid(Text1.Text, 1, (backlength - 1))
'save that text without the last character into the string
Text1.Text = backString
'display the string in the text box
End Sub
'You can replace Text1.Text with a string name

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 80 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.