|
eedu247
|
Please help me with vb code to make label to scroll on a form.
|
|
|
|
|
|
sweet_pawn
|
Place a label,a timer and command button on the form. In the timer event procedure write this: label1.left=label1.left - 10 if label1.left< -label1.width then label1.left= form.width end if Write this in button click event: timer1.interval=100 timer1.enabled=true label1.left= form.width When you run, click the button & label will scroll from right to left!
|
|
|
|
|
|
eedu247
|
Thanks sweet pawn ,but it moves 4rm left2right i change lefts 2 rights yet it refuse 2wrk. Could u pls giv me steps2 put date and time on my form.GOD blessing
|
|
|
|
|
|
sweet_pawn
|
Hello Edu! Seems you want your marquee to move from right to left. I will modify the code I posted above to suit your need. To add date and time to your form , add another label to the form and write this code in the timer event: label2.caption= Now
|
|
|
|
|
|
sweet_pawn
|
Hello Edu! Seems you want your marquee to move from right to left. I will modify the code I posted above to suit your need. To add date and time to your form , add another label to the form and write this code in the timer event: label2.caption= Now
|
|
|
|
|
|
s4
|
Add the follow code to a form, then add a timer on the form and run
'This code move your form caption from left to 'right. Dim str As String Dim leng As Integer Private Sub form_load() str = "Anil Iyengar" + Space(150) leng = Len(str) - 1 End Sub Private Sub Timer1_Timer() str = Left(Right(str, 1), leng) + Left(str, leng) 'To move caption from right to left 'just change 'str = Left(Right(str, leng), leng) + Left(str, 1)
Form1.Caption = str End Sub
|
|
|
|
|
|