Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make mouse visible on picturebox?

Status
Not open for further replies.

Madz

Technical User
Jan 31, 2001
33
0
0
SE
I am making a screensaver and want to detect the mouse..

I have a picture-box that draw some gfx. The problem is that the mouse pointer is located under the picture-box (on the form). How to make so that the pointer is located "on top" of the picture -box?

Thanks in advance
/mats.
ps. my "mouse detection" look like this:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static x0 As Integer
Static y0 As Integer

' Do nothing except in screen saver mode.
If RunMode <> rmScreenSaver Then Exit Sub

' Unload on large mouse movements.
If ((x0 = 0) And (y0 = 0)) Or _
((Abs(x0 - X) < 5) And (Abs(y0 - Y) < 5)) _
Then
' It's a small movement.
x0 = X
y0 = Y
Exit Sub
End If

Unload Me
End Sub
 
I don't know what you mean &quot;the mouse pointer is under the picture box&quot;

If you put the code in Picture1_MouseMove event, that should do what you want.

HTH.


______________________________
- David Lanouette
- Lanouette Consulting, LLC
- DLanouette@Computer.org
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top