954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Word running or marquee in text box

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!

br

dwiniers
Junior Poster in Training
57 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

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!

Capritarius21
Newbie Poster
20 posts since Jan 2010
Reputation Points: 15
Solved Threads: 4
 

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

dwiniers
Junior Poster in Training
57 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

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

dwiniers
Junior Poster in Training
57 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You