像楼上说的那样 用时钟 获取鼠标位置 然后将鼠标直接赋值给窗口的坐标 代码: Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long '先调用GetCursorPos函数,用来获取鼠标坐标的 Private Type POINTAPI x As Long y As Long End Type Dim pos As POINTAPI Private Sub Form_Load() Timer1.Interval = 10 End Sub Private Sub Timer1_Timer() GetCursorPos pos Form1.Top = pos.y * Screen.TwipsPerPixelY '直接将获取的鼠标坐标通过TIMER控件实时赋给窗口坐标 Form1.Left = pos.x * Screen.TwipsPerPixelX End Sub 望采纳。。
温馨提示:内容为网友见解,仅供参考