I am trying to automatically "center" the Form 4D prints using PRINT FORM.

For some reason no matter where the form objects are placed I keep getting
the same coordinates in the first line of code below:

`Form event On Load

OBJECT GET COORDINATES(*;"@";$lLeft;$lTop;$lRight;$lBottom)  //The form
GET PRINTABLE AREA($lHeight;$lWidth)
GET PRINTABLE MARGIN($lLeft1;$lTop1;$lRight1;$lBottom1)  //The print margin

  //Get the H center displacement of Form
$lHorizCenterF:=($lRight-$lLeft)/2
$lHorizCenterP:=$lLeft1+($lWidth/2)
$lMoveH:=$lHorizCenterF-$lHorizCenterP

  //Get the V Center displacement of Form
$lVerticalCenterF:=($lBottom-$lTop)/2
$lVerticalCenterP:=$lTop1+($lHeight/2)
$lMoveV:=$lVerticalCenterF-$lVerticalCenterP

OBJECT MOVE(*;"@";$lMoveH;$lMoveV)



-- 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"There must be ingenuity as well as intention, strategy as well as
strength. "
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to