在VB设计背景动画图案的步骤
在VB设计背景动画图案的步骤
窗体布局:
控件:timer1 屬性设置:timer1.Interval=1
代码:
Dim k As Integer
Private Sub Timer1_Timer()
k = k + 20
Line (Me.Width / 2, Me.Height / 2)-(0, k), RGB(0, 0, Abs(255 - k / 24))
Line (Me.Width / 2, Me.Height / 2)-(k, 0), RGB(0, 0, Abs(255 - k / 24))
Line (Me.Width / 2, Me.Height / 2)-(k, 0), RGB(0, 0, Abs(255 - k / 24))
Line (Me.Width / 2, Me.Height / 2)-(Me.Width, k), RGB(0, 0, Abs(255 - k / 24))
Line (Me.Width / 2, Me.Height / 2)-(Me.Width, k), RGB(0, 0, Abs(255 - (Me.Height - k) / 24))
Line (Me.Width / 2, Me.Height / 2)-(k, Me.Height), RGB(0, 0, Abs(255 - k / 24))
Line (Me.Width / 2, Me.Height / 2)-(k, Me.Height), RGB(0, 0, Abs(255 - k / 24))
Line (Me.Width / 2, Me.Height / 2)-(0, k), RGB(0, 0, Abs(255 - (Me.Height - k) / 24))
If k > 12500 Then
Timer1.Enabled = False
end if
End Sub