iNET Interactive - Online Advertising Agency
          
Go Back  Xtreme .NET Talk > .NET > Graphics and Multimedia > Mouse coordinates


Reply
 
Thread Tools Display Modes
  #1  
Old 05-04-2003, 12:44 PM
hog's Avatar
hog hog is offline
Senior Contributor

Preferred language:
VB .Net
 
Join Date: Mar 2003
Location: UK
Posts: 984
Default Mouse coordinates

How do you get the X,Y coords of a mouse click relative to you apps form rather than the entire screen?

When I get the location using Cursor.Position.X and Cursor.Position.Y I get a value way bigger than expected?

Ah, just used this:

Code:
pntMousePos.X = Me.Cursor.Position.X

But what happens is the Me object X return 381 but 769 get assigned to pntMousePox.X??
__________________
My website

Last edited by hog : 05-04-2003 at 12:58 PM.
Reply With Quote
  #2  
Old 05-04-2003, 02:03 PM
mutant
 
Posts: n/a
Default

This will do it:
Code:
Me.PointToClient(Me.Cursor.Position).ToString()
'to string so you can show it in msgbox, textbox or whatever or just remove to string if you dont need to show it
 
Reply With Quote
  #3  
Old 05-04-2003, 02:09 PM
hog's Avatar
hog hog is offline
Senior Contributor

Preferred language:
VB .Net
 
Join Date: Mar 2003
Location: UK
Posts: 984
Default

I'll give it a whirl and see what happens, cheers
__________________
My website
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Asp.net methods to find mouse coordinates? LiLo ASP.NET 3 03-20-2006 08:14 PM
DirectInput - Mouse coordinates problem. wyrd DirectX 3 10-18-2003 10:39 PM
Get Mouse Coordinates.. rustyfancy Windows Forms 3 08-07-2003 10:40 AM
Move the Mouse and Click the Mouse Diablicolic Windows Forms 5 08-03-2003 06:39 PM
Bezier coordinates hog Graphics and Multimedia 1 06-16-2003 09:08 AM

Advertisement: