Hola una forma que conozco es usando el Api WindowsFromPoint y un Timer.
Coloca un Timer1 y pegá esto:
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim posicion As POINTAPI, retHwnd As Long
Private flag As Boolean
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
MouseArriba
End Sub
Private Sub Timer1_Timer()
MouseOut
End Sub
Private Sub dibujar(Colorback As Long, SCaption As String, _
ColorFont As Long, ElForm As Form)
Dim izq As Single, arriba As Single
flag = False
With ElForm
.BackColor = Colorback
.ForeColor = ColorFont
End With
izq = (ElForm.ScaleWidth - TextWidth(SCaption)) / 2
arriba = (ElForm.ScaleHeight - TextHeight(SCaption)) / 2
ElForm.CurrentX = izq
ElForm.CurrentY = arriba
ElForm.Print SCaption
End Sub
Private Sub Form_Load()
With Me
.AutoRedraw = True
.FontName = "MS Sans Serif"
.Font.Size = 10
End With
dibujar vbWhite, "Hola", vbBlack, Me
Timer1.Interval = 10
End Sub
Private Sub Mover()
If flag = False Then
dibujar vbBlack, "Mundo", vbWhite, Me
flag = True
End If
End Sub
Private Sub MouseOut()
GetCursorPos posicion
retHwnd = WindowFromPoint(posicion.X, posicion.Y)
If retHwnd <> hWnd And flag = True Then
dibujar vbWhite, "Hola", vbBlack, Me
End If
End Sub
Private Sub MouseArriba()
flag = False
Mover
Timer1.Enabled = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Mover
End Sub