Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can a mouse click be detected outside of a modal form
Message
 
To
26/10/2006 13:10:30
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01164759
Message ID:
01164918
Views:
13
Hi Mike,

Please see if this is what you want:
oFrm1=CreateObject('Form1')
oFrm1.Show(1)
Define Class form1 As Form
	AutoCenter=.T.
	Id=''
	Add Object Cmd1 As CommandButton With Caption='Launch Modal Form',Width=240,Height=60

	Procedure Cmd1.Click
	Store Sys(3) To cID,Thisform.Id && Difference instances will have different IDs
	On Key Label Mouse Do MouseTrap With &cID
	oFrm2=CreateObject('Form')
	oFrm2.Show(1)
	On Key Label Mouse
	Endproc
EndDefine

Function MouseTrap
Lparameters nID
oObj=Sys(1270)
Do While Type('oObj.Parent')='O'
	oObj=oObj.Parent
EndDo
If Type('oObj.ID')='C' And Val(oObj.Id)=nID
	? 'Clicked on mother form'
EndIf
Ben


>I have a modal form that I show when a button is selected on another form. Is there any way to determine when a user has clicked on the underlying form (the one that contains the button that launched the modal form)?
>
>TIA
>Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform