展开全部
简单示例,你需要再扩展
Option Explicit
Dim bM As Boolean
Private Sub Command1_Click()
bM = Not bM
Call MoveFrm
End Sub
Sub MoveFrm()
Dim iM As Long
iM = 100
Do While bM
With Me
.Left = .Left + iM
If .Left <= 0 Or (.Left + .Width) > Screen.Width Then iM = iM * -1
End With
DoEvents
Loop
End Sub
Option Explicit
Dim bM As Boolean
Private Sub Command1_Click()
bM = Not bM
Call MoveFrm
End Sub
Sub MoveFrm()
Dim iM As Long
iM = 100
Do While bM
With Me
.Left = .Left + iM
If .Left <= 0 Or (.Left + .Width) > Screen.Width Then iM = iM * -1
End With
DoEvents
Loop
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询