level 5
代码可以简化
If Timer1.Enabled then
Timer1.Enabled=false
else
Timer1.Enabled =true
end if
或者直接一行
Timer1.Enabled = not Timer1.Enabled
请问Form_load、Mousedown中的Radomize存在有何意义,又没有用随机数函数Rnd。
后面的代码用了 and 又是什么意义
这个你试试,可以左右移动
Static N As Boolean
If N Then
Label1.Left = Label1.Left + 200
If Label1.Left + Label1.Width >= Form1.ScaleWidth Then
Label1.Left = Form1.ScaleWidth - Label1.Width
N = False
End If
Else
Label1.Left = Label1.Left - 200
If Label1.Left <= 0 Then
Label1.Left = 0
N = True
End If
End If
变量N要么用外部,要么用静态
2023年12月19日 08点12分
