- Home
·
- String Manipulation
·
- Takes the text from a simple text box and reverses it to display it backwards in another box.
Takes the text from a simple text box and reverses it to display it backwards in another box.
Takes the text from a simple text box and reverses it to display it backwards in another box.
Rate Takes the text from a simple text box and reverses it to display it backwards in another box.
(1(1 Vote))
'If you have and improvements for this code please e-mail me.
'Check out my emulation webpage at http://gone4good.topcities.com
Dim TxtLen As Integer
Private Sub Command1_Click()
TxtLen = Len(Text1)'gets length of original text
Text2.Text = "" 'clears the second text box
Text1.Locked = True 'disables the first text box
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii = 13) Then Command1_Click 'starts by pressing enter key
End Sub
Private Sub Timer1_Timer()
'adds furthest letter of text1 to text2
Text2.Text = Text2.Text & Right(Text1.Text, 1)Text1.SetFocus
'next 3lines remove the last letter from text1
If Len(Text1) > 0 Then Text1.SelStart = Len(Text1) - 1
Text1.SelLength = 1
Text1.SelText = ""
If Len(Text2) = TxtLen Then
Timer1.Enabled = False
Text1.Locked = False
End If
End Sub
Takes the text from a simple text box and reverses it to display it backwards in another box. Comments
No comments yet — be the first to post one!
Post a Comment