|
luckyCO
|
I would love you to have posted this on the forum which I called Post your VB6.0 question here. This will enable me to answer it as soon as I enter into the thread. U can also post any other one in a fresh thread and will be appreciated if you post it there for me to answer.
Now I will give you code for Left,Right,down and Button marque
You have four timers and four labels,put then on a form ,choose whichever that serves your purpose.
Private Sub Timer1_Timer() Call MoveRight(Label1, Me) End Sub
' the one you asked for Private Sub Timer2_Timer() Call MoveLeft(Label2, Me) End Sub
Private Sub Timer3_Timer() Call MoveUP(Label3, Me) End Sub
Private Sub Timer4_Timer() Call MoveDown(Label4, Me) End Sub
'Function calls
Public Sub MoveLeft(Obj As Control, frm As Form) Obj.Move Obj.Left + 30 If Obj.Left > frm.Width Then Obj.Left = -1 * (frm.ScaleWidth) End If End Sub
Public Sub MoveRight(Obj As Control, frm As Form) Obj.Move Obj.Left - 30 If (Obj.Left + Obj.Width) < 0 Then Obj.Left = frm.Width End If End Sub
Public Sub MoveUp(Obj As Control, frm As Form) Obj.Move Obj.Left, Obj.Top + 30 If Obj.Top > frm.Height Then Obj.Top = -1 * (frm.ScaleHeight) End If End Sub
Public Sub MoveDown(Obj As Control, frm As Form) Obj.Move Obj.Left, Obj.Top - 30
If (Obj.Top + Obj.Height) < 0 Then Obj.Top = frm.Height End If End Sub
If you have problem you can call 08036025235 Thanks
|