VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A Happy New Year label that moves across the screen and appears wherever you click the screen.

by S.K.Dogra (4 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 12th June 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

A "Happy New Year" label that moves across the screen and appears wherever you click the screen.

Rate A Happy New Year label that moves across the screen and appears wherever you click the screen.



Dim Cntr, Direct As Integer

Private Sub Form_Click()
: Flower
Call Timer2_Timer
End Sub
Function Flower()
Label1.Left = x1
Label1.Top = y1
 End Function

Private Sub Form_Load()
x1 = Rnd * 10000
y1 = Rnd * 10000
Timer1.Interval = 50
Timer2.Interval = 150
Timer3.Interval = 4000
Label1.FontSize = 32
Label1.FontName = "Times New Roman"
Label1.Height = 975
Label1.Width = 4800
Label1.Caption = "Happy New Year"
Label1.ForeColor = RGB(256, 0, 0)
Label1.BackColor = RGB(240, 220, 220)

End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
x1 = X
y1 = Y
PSet (x1, y1)
End Sub

Private Sub Timer1_Timer()
: Flower
End Sub

Private Sub Timer2_Timer()
Refresh
If Direct > 5 Then
x1 = x1 + 100
y1 = y1 + 50
ElseIf Direct < 6 Then
x1 = x1 - 100
y1 = y1 - 50
End If
: Flower
End Sub

Private Sub Timer3_Timer()
Direct = Rnd * 10
x1 = Rnd * 8000
y1 = Rnd * 8000
Label1.ForeColor = RGB(Rnd * 256, Rnd * 256, Rnd * 256)
Label1.BackColor = RGB(Rnd * 256, Rnd * 256, Rnd * 256)
End Sub



Download this snippet    Add to My Saved Code

A Happy New Year label that moves across the screen and appears wherever you click the screen. Comments

No comments have been posted about A Happy New Year label that moves across the screen and appears wherever you click the screen.. Why not be the first to post a comment about A Happy New Year label that moves across the screen and appears wherever you click the screen..

Post your comment

Subject:
Message:
0/1000 characters