how do I trim 1 character from the left of a text box?
Printable View
how do I trim 1 character from the left of a text box?
text1.text=right (text1.text,len(text1.text)-1)
after that, how do I get it so that it brings the focus to the end again? (with out using send keys)
Private Sub Command1_Click()
Text1.Text = Right(Text1.Text, Len(Text1.Text) - 1)
Text1.SelStart = Len(Text1.Text)
Text1.SetFocus
End Sub
Not much different from asabi, but trim method
Code:Private Sub Command1_Click()
Text1.Text = Mid$(Text1, 2)
Text1.SelStart = Len(Text1)
Text1.SetFocus
End Sub