Hello there i need your help and expertise. Anybody can help me how to make a code or how to make a word running like marquee in a text box. Thanks in advance!


Recommended Answers

All 3 Replies

Got this from a source, try it:

First you have to include Timer and Label control in the Form.
Then type the ff in the code section.

Option Explicit
Dim s As String

Private Sub Form_Load()
s = "Possibilities are endless "
Timer1.Interval = 300
Timer1.Enabled = True
Label1.AutoSize = True
End Sub

Private Sub Timer1_Timer()
Dim n As Integer
Static t As String
Static ndx As Integer
If Len(t) = 0 Then t = Space$(20)
n = Len(s)
ndx = (ndx Mod n) + 1
Mid$(t, 1, 19) = Mid$(t, 2, 19)
Mid$(t, 20, 1) = Mid$(s, ndx, 1)
Label1 = t
End Sub

For any queries feel free to post a reply. Enjoy!

Ok sir i will try it. Thanks u very much. I just post the result....

Thank you very guys specially to Capritarius21. I got the idea of your given code. Finally i find a working code thru surfing. But still i cannot understand. Can explain it to me or simulate how the code is working specially the mentioned variable what its means??? Thank you very

Here's the Code"

dim str as string
dim i as integer

Private Sub Form_Load()
str = Text1.Text
i = 0
End Sub

Private Sub Timer1_Timer()
Timer1.Interval = 100
i = i + 1
Text1.Text = Left(str, i)
If i = Len(str) Then
i = 1
Timer1.Interval = 100
End If
End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.