I've changed your timer event slightly:
The problem is that with GetCursorPos you get the mouse position counted from the upper left position of the screen and that may not be where your form is positioned.Code:Private Sub tmrtext_Timer() Dim lX, lY Dim point As POINT_API Dim iDiffX%, iDiffY% iDiffX = Me.Width - Me.ScaleWidth - 5 * Screen.TwipsPerPixelX iDiffY = Me.Height - Me.ScaleHeight GetCursorPos point lX = ScaleX(point.x, vbPixels, Me.ScaleMode) lY = ScaleY(point.y, vbPixels, Me.ScaleMode) ' Screen.TwipsPerPixelY lblDrawText.Left = lX - Me.Left - iDiffX lblDrawText.Top = lY - Me.Top - iDiffY End Sub
Good luck!
[Edited by Joacim Andersson on 08-04-2000 at 04:01 AM]




Reply With Quote