Language Reference Guide : System Classes : FormField Class : AnchorPoint Attribute
 
Share this page          
AnchorPoint Attribute
Data Type: integer
4GL Access: RW
Anchoring an object keeps it in one place. When you move the object, it remains positioned relative to the same point on the page. The AnchorPoint attribute can be used to specify one of nine predetermined anchor points for the field. These points are given by the vertices and centers.
Valid values are:
AP_NONE
AP_TOPLEFT
AP_TOPCENTER
AP_TOPRIGHT
AP_CENTERLEFT
AP_CENTER
AP_CENTERRIGHT
AP_BOTTOMLEFT
AP_BOTTOMCENTER
AP_BOTTOMRIGHT
Descriptions of system constant values and their numeric equivalents are listed in AnchorPoint Settings.
Objects are created with an AnchorPoint of AP_NONE. To position an object using its AnchorPoint, specify values for the XAnchorPoint and YAnchorPoint attributes.
For example, the following settings align two objects on the right edge along the line X = 1000:
obj1.AnchorPoint = AP_CENTERRIGHT;
obj2.AnchorPoint = AP_CENTERRIGHT;
obj1.XAnchorPoint = 1000;
obj1.YAnchorPint = 1000;
obj2.XAnchorPoint = obj1.XAnchorPoint;
obj2.YAnchorPoint = 200;
Note:  Positioning by anchor point setting occurs at runtime. Attempts to change the size of an object leaves the anchor point at its original location.
Refer also to the Width Attribute and the YAnchorPoint Attribute for more information about positioning objects.