Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's wrong in my code?
Message
From
21/04/2005 07:08:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01006642
Message ID:
01006892
Views:
29
This message has been marked as the solution to the initial question of the thread.
.Top is relative to its parent. ObjToClient result is relative to form.
You could instead use sys(1270) as a shortcut.
Cetin

>Disregard. After I changed right and bottom to use button's properties, it worked. Not sure, why there is a difference between using objToClient and .top.
>
>Hi everyone,
>
>I'm looking at this simple thing longer than it should take but could not find a problem. I used top and left + pageframe top/left, then switched to objtoClient, but my code is still not working. Could it be a problem with Pages collection? If yes, how can I reference an active page?
>
>Thanks.
>
>local nCancelTop, nCancelHeight, nCancelLeft, nCancelWidth, llReturn, lnMousePosY, lnMousePosX
>lnMousePosY = mrow(thisform.name,3)
>lnMousePosX = mcol(thisform.name,3)
>with thisform.pgPatient.pages(thisform.pgPatient.activepage)
>	nCancelTop = OBJTOCLIENT(.cmdCancel, 1)
>	nCancelBottom = m.nCancelTop + OBJTOCLIENT(.cmdCancel, 4)
>	nCancelLeft = OBJTOCLIENT(.cmdCancel, 2)
>	nCancelRight = m.nCancelLeft + OBJTOCLIENT(.cmdCancel, 3)
>endwith
>
>llReturn = .f.
>
>if between(m.lnMousePosY,m.nCancelTop,m.nCancelBottom) and ;
>		between(m.lnMousePosX,m.nCancelLeft,m.nCancelRight) and ;
>		mdown()
>	llReturn = .t.
>endif
>
>return m.llReturn  or lastkey()= 46 or thisform.releasetype = 1 && Alt+C (shortcut for Cancel)
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform