用VB 的Timer控件怎样让LINE在窗体上慢慢画
是我没说清楚要按一下按纽才开始画点应该怎么做呢PrivateSubCommand1_Click()Picture1.Scale(-45,45)-(45,-45)Dimx1...
是我没说清楚 要按一下按纽才开始画点 应该怎么做呢
Private Sub Command1_Click()
Picture1.Scale (-45, 45)-(45, -45)
Dim x1 As Double
Dim y1 As Double
Dim i As Long
x1 = 8
y1 = 36
Do While i < 100
Picture1.PSet (x1, y1)
x1 = x1 - 0.17
y1 = y1 - 0.7
i = i + 1
Loop
End Sub
Timer1怎么控制它的速度 展开
Private Sub Command1_Click()
Picture1.Scale (-45, 45)-(45, -45)
Dim x1 As Double
Dim y1 As Double
Dim i As Long
x1 = 8
y1 = 36
Do While i < 100
Picture1.PSet (x1, y1)
x1 = x1 - 0.17
y1 = y1 - 0.7
i = i + 1
Loop
End Sub
Timer1怎么控制它的速度 展开
展开全部
Option Explicit
Dim i, j
Private Sub Form_Load()
Me.AutoRedraw = True
i = Me.Width / 2
j = Me.Height / 2
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim step1, step2
Randomize
step1 = Int(Rnd * 1000)
If Rnd < 0.5 Then step1 = -step1
step2 = Int(Rnd * 1000)
If Rnd < 0.5 Then step2 = -step2
Me.DrawWidth = Int(Rnd * 5) + 1
Me.Line (i, j)-(i + step1, j + step2), QBColor(Rnd * 15)
i = i + step1
j = j + step2
If i > Me.Width Or i < 0 Then i = Me.Width / 2
If j > Me.Height Or j < 0 Then j = Me.Width / 2
End Sub
'主要是在TIMER控件中慢慢画就行
Dim i, j
Private Sub Form_Load()
Me.AutoRedraw = True
i = Me.Width / 2
j = Me.Height / 2
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim step1, step2
Randomize
step1 = Int(Rnd * 1000)
If Rnd < 0.5 Then step1 = -step1
step2 = Int(Rnd * 1000)
If Rnd < 0.5 Then step2 = -step2
Me.DrawWidth = Int(Rnd * 5) + 1
Me.Line (i, j)-(i + step1, j + step2), QBColor(Rnd * 15)
i = i + step1
j = j + step2
If i > Me.Width Or i < 0 Then i = Me.Width / 2
If j > Me.Height Or j < 0 Then j = Me.Width / 2
End Sub
'主要是在TIMER控件中慢慢画就行
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询