|
-
Nov 15th, 2003, 01:20 PM
#1
Thread Starter
Member
Mouse Location - Not Position :RESOLVED
I need to find the mouse cursor location X/Y on my windows control library.
When writing a windows application I can use the following math but it does not work on a control library since I am using internet explorer to view the form instead:
X = MousePosition.X - Me.Location.X
Y = MousePosition.Y - Me.Location.Y
In a windows control library the Me X/Y never changes even if internet explorer is moved. The Mouse X/Y postition is where it is at on the screen not the form.
Last edited by DinoRoger; Nov 16th, 2003 at 10:41 AM.
-
Nov 15th, 2003, 08:19 PM
#2
I wonder how many charact
You need to implement a PointToScreen(MousePosition) to retrieve the screen coordinates.
-
Nov 16th, 2003, 10:41 AM
#3
Thread Starter
Member
Found the solution:
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove lblX.Text = "X= " + e.X.ToString lblY.Text = "Y= " + e.Y.ToString End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|