Comando movil
Hola: tengo un form en el que hay botones de comando y quiero que luego de que se presione una vez, el comando se mueva fuera del alcance del puntero, evitando el click sobre el. Alguien sabe como se logra esto??
Gracias
Gracias
Ya me pasaron la solución. La dejo por si a alguien le interesa:
Dim Estado As Boolean
Private Sub Command1_Click()
Estado = True
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single,
Y As Single)
If Estado = True Then
Command1.Top = X + Rnd(10) * Int((Rnd(10) * 10) + 1) * 100
Command1.Left = Y + Rnd(10) * Int((Rnd(10) * 10) + 1) * 100
If Command1.Top > Me.Height Then Command1.Top = 0
If Command1.Left > Me.Width Then Command1.Left = 0
End If
End Sub
Dim Estado As Boolean
Private Sub Command1_Click()
Estado = True
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single,
Y As Single)
If Estado = True Then
Command1.Top = X + Rnd(10) * Int((Rnd(10) * 10) + 1) * 100
Command1.Left = Y + Rnd(10) * Int((Rnd(10) * 10) + 1) * 100
If Command1.Top > Me.Height Then Command1.Top = 0
If Command1.Left > Me.Width Then Command1.Left = 0
End If
End Sub
