VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Takes the text from a simple text box and reverses it to display it backwards in another box.

by Matt Beighton (3 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 21st June 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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.



'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


Download this snippet    Add to My Saved Code

Takes the text from a simple text box and reverses it to display it backwards in another box. Comments

No comments have been posted about Takes the text from a simple text box and reverses it to display it backwards in another box.. Why not be the first to post a comment about Takes the text from a simple text box and reverses it to display it backwards in another box..

Post your comment

Subject:
Message:
0/1000 characters