Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private Type POINTAPI X As Long Y As Long End Type Dim Point1 As POINTAPIPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Form1.Cls str1 = "I love you" GetCursorPos Point1 TextOut Form1.hdc, Point1.X, Point1.Y, str1, Len(str1) End Sub
Label1.Move X, Y
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim Point1 As POINTAPIPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.Cls
str1 = "I love you"
GetCursorPos Point1
TextOut Form1.hdc, Point1.X, Point1.Y, str1, Len(str1)
End Sub