这次真的没办法了,救我,timer问题vb
这次真的没办法了,救我,timer问题抢个沙发21楼PrivateSubForm_Click()DimtAsSingle,rAsSingleFontSize=42t=Te...
这次真的没办法了,救我,timer问题
抢个沙发2 1楼
Private Sub Form_Click()
Dim t As Single, r As Single
FontSize = 42 t = TextWidth("功夫再高,也怕菜刀")
r = TextHeight("功") CurrentX = (ScaleWidth - t) / 2
CurrentY = (ScaleHeight - r) / 2
Print ("功夫再高,也怕菜刀")
Timer1.Enabled = True End Sub Private Sub Form_Load() Timer1.Enabled = False
Timer1.Interval = 1000
End Sub Private Sub Timer1_Timer()
Print Time
Randomize
Form1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
End Sub我想每秒钟字体颜色变一次可是却是点一次变一次,求指教
print time可以不管它 展开
抢个沙发2 1楼
Private Sub Form_Click()
Dim t As Single, r As Single
FontSize = 42 t = TextWidth("功夫再高,也怕菜刀")
r = TextHeight("功") CurrentX = (ScaleWidth - t) / 2
CurrentY = (ScaleHeight - r) / 2
Print ("功夫再高,也怕菜刀")
Timer1.Enabled = True End Sub Private Sub Form_Load() Timer1.Enabled = False
Timer1.Interval = 1000
End Sub Private Sub Timer1_Timer()
Print Time
Randomize
Form1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
End Sub我想每秒钟字体颜色变一次可是却是点一次变一次,求指教
print time可以不管它 展开
展开全部
Private Sub Form_Click()
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim t As Single, r As Single
Print Time
Randomize
Form1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
FontSize = 42
t = TextWidth("功夫再高,也怕菜刀")
r = TextHeight("功")
CurrentX = (ScaleWidth - t) / 2
CurrentY = (ScaleHeight - r) / 2
Print ("功夫再高,也怕菜刀")
End Sub '我想每秒钟字体颜色变一次可是却是点一次变一次,求指教
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim t As Single, r As Single
Print Time
Randomize
Form1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
FontSize = 42
t = TextWidth("功夫再高,也怕菜刀")
r = TextHeight("功")
CurrentX = (ScaleWidth - t) / 2
CurrentY = (ScaleHeight - r) / 2
Print ("功夫再高,也怕菜刀")
End Sub '我想每秒钟字体颜色变一次可是却是点一次变一次,求指教
展开全部
你把Form1_Click()改成Form1_Load() ,在单击事件下,TImer是单击一次窗体执行一次。
追问
我懂你们的意思了,不过在加载窗体中print方法没有发生。。。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Click()应该改成
Private Sub Form_Load()
Private Sub Form_Load()
追问
还是不行呀
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你的代码是写在点击事件里的,点一次执行一遍
追问
我点了的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询