很简单的动态效果
vb吧
全部回复
仅看楼主
level 7
混子√ 楼主
interval设置为200.
Option Explicit
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer2.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub Timer1_Timer()
Static a As Integer
a = a + 1
If a = 1 Then lbljd.Caption = "─"
If a = 2 Then lbljd.Caption = "\"
If a = 3 Then lbljd.Caption = "│"
If a = 4 Then lbljd.Caption = "/": a = 0
End Sub
Private Sub Timer2_Tim
er()
Static b As Integer
b = b + 1
If b = 1 Then lbljd2.Caption = "."
If b = 2 Then lbljd2.Caption = ".."
If b = 3 Then lbljd2.Caption = "..."
If b = 4 Then lbljd2.Caption = "...."
If b = 5 Then lbljd2.Caption = ".....": b = 0
End Sub
2020年10月20日 16点10分 1
吧务
level 13
为什么要用两个计时器?一个足够了。
2020年10月20日 16点10分 2
[哈哈]谢谢吧主提醒。其中一个从我的程序里面提出来,后来发现还可以做很多类似的。放在StutasBar挺实用,还很简单。
2020年10月21日 04点10分
level 10
[大拇指]
2020年10月24日 10点10分 3
level 10
楼主,你是“按代码行数”算工资的吧!!!
[滑稽][滑稽][滑稽]
你的那“一大片的if语句”,既不优雅,也是“低效率代码”的典范。
最起码,你用 Select语句块,也显得有条理一些啊。
你的那“一大段if”的代码,都可以“两行代码”搞定的。
第1段:
a = (3 And a) + 1
lbljd.Caption = Mid$("/─\│/", a, 1)
第2段:
b = b Mod 5 + 1
lbljd2.Caption = Left$(".....", b)
2020年10月25日 14点10分 4
上面“第1段”的 多了1个/字符。但不影响结果。[滑稽]
2020年10月25日 14点10分
1