Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Carlos Alloatti
  Where is Carlos Alloatti?
 
 Vatican City State (Holy See)
 Carlos Alloatti
 To: Thomas Peirson-Webber
  Where is Thomas Peirson-Webber?
 London
 United Kingdom
 Thomas Peirson-Webber
 Tags
Subject: RE: LOCATION OF MOUSE
Thread ID: 268490 Message ID: 268515 # Views: 42 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Monday, July 12, 2010 10:32:44 PM         
   


> >
> > Screen coordinates or form coordinates? (Windows screen, not VFP _Screen)
> >
> > You could also use the info provided in the MouseDown event
> >
> > ---
> > Carlos Alloatti
>
>
>
> Form coordinates ideally. Would they relate to the form pixels?
>
> Thanks for your continued help

The simplest way would be to save the nXCoord, nYCoord parameters of MouseUp in form/object properties, and use them in Click event.

nXCoord and nYCoord are in form coordinates in pixels.


Public oform1

oform1=Newobject("form1")
oform1.Show
Return

Define Class form1 As Form

	DoCreate = .T.
	AutoCenter = .T.
	Caption = "Form1"
	AllowOutput = .F.
	Name = "Form1"

	Add Object command1 As CommandButton With ;
		Top = 36, ;
		Left = 48, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Command1", ;
		Name = "Command1"

	Procedure command1.Click
		?This.nXCoord, This.nYCoord
	Endproc

	Procedure command1.MouseUp
		Lparameters nButton, nShift, nXCoord, nYCoord
		This.AddProperty("nXCoord", m.nXCoord)
		This.AddProperty("nYCoord", m.nYCoord)
	Endproc

Enddefine




---
Carlos Alloatti

ENTIRE THREAD

LOCATION OF MOUSE Posted by Thomas Peirson-Webber @ 7/12/2010 5:34:44 PM
RE: LOCATION OF MOUSE Posted by Carlos Alloatti @ 7/12/2010 7:03:22 PM
RE: LOCATION OF MOUSE Posted by Thomas Peirson-Webber @ 7/12/2010 7:41:46 PM
RE: LOCATION OF MOUSE Posted by Carlos Alloatti @ 7/12/2010 10:32:44 PM
RE: LOCATION OF MOUSE Posted by tushar @ 7/12/2010 7:09:53 PM
RE: LOCATION OF MOUSE Posted by Yousfi Benameur @ 7/12/2010 7:30:43 PM