Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Screen Coord vrs Foxpro Forms coord
Message
From
20/10/2002 18:37:30
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00713318
Message ID:
00713353
Views:
21
>That's ok, I see what you mean, but there is still a diference when there are some toolbars and the sysmenu active, how can I know that to make the coord equal?
>
>better yet, I need the title bar and the border of the form, need a way to make a rational!!!

Ok :)
Download this file http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~2,2,14876
* Init event
Procedure Init
Public oFM
   oFM = NewObject('FormMetric', 'HTWindow')
   oFM.GetSysMetric(ThisForm)
EndProc

* MouseMove event
Procedure MouseMove
LParameters nButton, nShift, nXCoord, nYCoord
   Local ln_Width, ln_Height

   * Assuming VFP title, VFP sysmenu, VFP toolbar and Form title is active
   * We need 4 times of title height
   If (_Screen.WindowState = 0)
      ln_Width = (oFM.fbWidth * 2) + 1
      ln_Height = (oFM.fbHeight * 3) + (oFM.ftHeight * 4)
   endif
   If (_Screen.WindowState = 2)
      ln_Width = oFM.fbWidth
      ln_Height = (oFM.fbHeight * 2) + (oFM.ftHeight * 4)
   endif
   Thisform.txtFormPos.Value = alltrim(str(nXCoord+ln_Width)) + ;
      [, ] + alltrim(str(nYCoord+ln_Height))
EndProc
That's the idea. You should actually find the real width and height for all objects, so it will work in any configuration.
HTH
Herman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform