How to Make Scrolling Credits
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 'Miscellaneous - How to Make Scrolling Credits 'Add a Timer Control and a Picture Box to your form and set Interval property of the Timer to 10 'Insert another Picture Box into the first Picture Box, and insert a Label into the second Picture Box. Private Sub Form_Load() With Picture1 .ScaleMode = 3 .BorderStyle = 0 .Width = Me.ScaleWidth .Height = Me.ScaleHeight .Left = 0 .Top = 0 End With Picture2.BorderStyle = 0 Picture2.Top = Picture1.ScaleHeight With Label1 .WordWrap = True .Left = 0 .Width = Picture2.ScaleWidth .FontSize = 12 'Enter here your scrolling text. You can add Images and another Labels to Picture2. they will scroll too. .Caption = "This is Example of scrolling credits. Visit our site at Go.to\VBHelp" .AutoSize = True .Top = 0 End With Picture2.Height = Label1.Height \ Screen.TwipsPerPixelY + 10 Picture2.Left = (Picture1.Width \ Screen.TwipsPerPixelX - Picture2.Width) / 2 End Sub Private Sub Label1_Click() Timer1.Enabled = Not Timer1.Enabled End Sub Private Sub Picture1_Click() Timer1.Enabled = Not Timer1.Enabled End Sub Private Sub Timer1_Timer() Picture2.Top = Picture2.Top - 1 If Picture2.Top <= -Picture2.Height Then Picture2.Top = Picture1.ScaleHeight End Sub |