Library code snippets
Scrolling Text
For this example, add a Picture Box (named picHolder) and a Timer (named tmrScroll) to your form. Next, add a label called lblMsg within the Picture Box, and enter a few lines of text into its caption property. Then, add the code below, and run your project!
Private Sub Form_Load()
lblMsg.Top = picHolder.Height
tmrScroll.Interval = 10
tmrScroll.Enabled = True
End Sub
Private Sub tmrScroll_Timer()
If lblMsg.Top > -lblMsg.Height Then
lblMsg.Top = lblMsg.Top - 10
Else
lblMsg.Top = picHolder.Height
End If
End Sub
Related articles
Related discussion
-
VB6, SQL 2005 & DMO
by elajaunie3 (1 replies)
-
sending sms from pc
by sriraj20074 (0 replies)
-
Automating Excel from VB6.0
by epurdy (0 replies)
-
VB6 system conversion using VBA to Word 2007
by b.macgregor@vodamail.co.za (0 replies)
-
video not working with visual basic
by Jupiter 2 (9 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
Private Sub picHolder_Click
tmrScroll.Interval = tmrScroll.Interval XOR 10
end sub
This works because 10 XOR 10 = 0, and 0 XOR 10 = 10. You can use any number.
By adding a simple code, you can click to start, and click to stop the scrolling:
Private Sub picHolder_Click()
If tmrScroll.Interval = 0 Then
tmrScroll.Interval = 10
Else
tmrScroll.Interval = 0
End If
End Sub
-Gaz
This thread is for discussions of Scrolling Text.