| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > WindowResizeClass > WindowResizeClass Methods >====== SetAnchor(set control's anchor strategy) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[restorewindow restore window to initial size .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[setparentcontrol set parent control .htm|{{btn_next_n.gif|Next page}}]] | | || **SetAnchor ( **//control, anchorStrategy//** )** {{blk2blue.jpg|blk2blue.jpg}} | **SetAnchor** | Sets the specific anchor strategy// //for a window //control//. | | //Control// | An integer constant, variable, EQUATE, or expression containing a control number. | | //anchorStrategy// | An integer constant, variable, EQUATE, or expression indicating the anchor strategy to apply to the //control//. There are five anchor strategies that are identified easily by a default set of EQUATES:**Anchor:None     EQUATE(0000b)****Anchor:Right    EQUATE(0001b)****Anchor:Left     EQUATE(0010b)****Anchor:Top      EQUATE(0100b)****Anchor:Bottom   EQUATE(1000b)** | The **SetAnchor** method is used to set the appropriate anchors for a control. Control's are anchored with respect to their parent control. **Implementation: **The Resizer **Init** method calls the **SetAnchor** method just after setting the parent control defaults via the **SetParentsDefaults** method. Anchoring is actually a variation of the centered resize strategy. **Example:** **Resizer.Init PROCEDURE(BYTE AppStrategy=AppStrategy:Resize,| ** **             BYTE SetWindowMinSize=False,BYTE SetWindowMaxSize=False)** **  CODE** **  PARENT.Init(AppStrategy,SetWindowMinSize,SetWindowMaxSize)** **  SELF.SetParentDefaults()!Calculate default control parent-child ** **                          !relationships based upon their positions** **                          !on the window** ** ****SELF.SetAnchor(?BOButton,Anchor:Bottom)** **See Also:     ****[[setparentdefaults set default parent controls .htm|SetParentDefaults]]**