Hi,
I am writing a program so when you write text in a text box it displays the same text in a label but backwards eg.
text box = Jason
label = nosaJ
Can someone please help me???
Thanks in advance.
Printable View
Hi,
I am writing a program so when you write text in a text box it displays the same text in a label but backwards eg.
text box = Jason
label = nosaJ
Can someone please help me???
Thanks in advance.
Thry this, it works.. :)
Word = Text1.Text
L = Len(Word)
Temp = String$(L, 32)
For x = 1 To L
a = Mid$(Word, x, 1)
Mid$(Temp, (L - x) + 1, 1) = a
Next x
Label1.Caption = Temp
If you have VB6, then you can use the StrReverse function like this:
Remember, that only works with VB6.Code:Private Sub Command1_Click()
Text1.Text = StrReverse(Text1.Text)
End Sub
------------------
Tom Young, 14 Year Old
[email protected]
ICQ: 15743470 Add Me ICQ Me
AIM: TomY10
PERL, JavaScript and VB Programmer
I did not know that... :) Learn somthing new here every day!!!
If you don't have VB6, add two labels on your form
Hope this works for youCode:Private Sub Form_Load()
Dim sstring As String
Dim iposition As Integer
Label1.Caption = "VB PROGRAMMER"
sstring = Label1.Caption
For iposition = Len(sstring) To 1 Step -1
Label2.Caption = Label2.Caption & Mid$(sstring, iposition, 1)
Next
End Sub
Ruchi
Just try formatting your string on the text click event, (in vb5) automatically reverses it.
txtEntry.Click()
txtEntry = UCASE(txtEntry)
Just add whatever code you want to use for this weird happening, e.g label = UCASE(txtEntry)