2个回答
展开全部
呵呵...给你个不要TIMER的..闪一下下..
Public Sub FlashTXT(StartTime As Long)
Dim TStart As Single, r As Byte, g As Byte, b As Byte
Dim i&
TStart = Timer
Randomize
While (Timer - TStart) < (StartTime / 1000)
i = i + 1
If i Mod 40000 = 0 Then
r = Int(256 * Rnd)
g = Int(256 * Rnd)
b = Int(256 * Rnd)
Label1.ForeColor = RGB(r, g, b)
End If
DoEvents
Wend
End Sub
Private Sub Form_Load()
Label1.FontSize = 14
Label1.AutoSize = True
Label1 = "这是一个无Timer的闪烁测试!!"
Me.Show
FlashTXT (2000)
Label1.ForeColor = 0
End Sub
Public Sub FlashTXT(StartTime As Long)
Dim TStart As Single, r As Byte, g As Byte, b As Byte
Dim i&
TStart = Timer
Randomize
While (Timer - TStart) < (StartTime / 1000)
i = i + 1
If i Mod 40000 = 0 Then
r = Int(256 * Rnd)
g = Int(256 * Rnd)
b = Int(256 * Rnd)
Label1.ForeColor = RGB(r, g, b)
End If
DoEvents
Wend
End Sub
Private Sub Form_Load()
Label1.FontSize = 14
Label1.AutoSize = True
Label1 = "这是一个无Timer的闪烁测试!!"
Me.Show
FlashTXT (2000)
Label1.ForeColor = 0
End Sub
展开全部
在窗口中加一个Timer,名为Timer1,假设你那个标签为Label1,那么
在通用声明里写上:
Dim tmp as string
Dim cout as integer
在窗体的load事件中写上:
Timer1.Interval=500
在Timer1的Timer事件中写上:
if Label.caption<>"" then
tmp=Label1.caption
Label1.caption=""
else
Label1.caption=""
end if
cout=cout+1
if cout=8 then Timer1.Enabled=false
追我分!!!
在通用声明里写上:
Dim tmp as string
Dim cout as integer
在窗体的load事件中写上:
Timer1.Interval=500
在Timer1的Timer事件中写上:
if Label.caption<>"" then
tmp=Label1.caption
Label1.caption=""
else
Label1.caption=""
end if
cout=cout+1
if cout=8 then Timer1.Enabled=false
追我分!!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询