如何实现当鼠标放到Commandbutton上时,Commandbutton自动移动,使鼠标不能点击Commandbutton
在command1_MouseMove事件中加入
command1.Left = command1.Left + command1.Width
:)这个只是向右移……
Private Sub Command1_Click()
MsgBox "OK"
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim x1 As Single, y1 As Single
x1 = Rnd * (Me.Width - Command1.Width)
y1 = Rnd * (Me.Height - Command1.Height - 240)
Command1.Move x1, y1
End Sub
Private Sub Form_Load()
Randomize
End Sub