Function CenterControl() Foundation

Center an Xbase Part within another object.

Syntax
CenterControl( <oControl>, [<oCenterIn>] ) --> NIL
Parameters
<oControl>
The Xbase Part to be centered.
<oCenterIn>
The Xbase Part to center <oControl> in. This parameter defaults to the parent object, causing <oControl> to be centered within its parent by default.
Return

The return value of CenterControl() is always NIL.

Description

The function CenterControl() centers the Xbase Part passed in parameter <oControl> another Xbase Part, usually the parent object. The size of the Xbase Part is not changed by CenterControl().

Examples
Centering a dialog on the screen
// The example illustrates the usage of CenterControl() 
// for centering a dialog on the screen. Furthermore, 
// the function is used to position a child object 
// of the dialog. 

PROCEDURE Main 

  LOCAL oMLE 

   // Center the default XbpCrt window created by 
   // procedure AppSys() on the screen. The object 
   // is the current application window. See 
   // procedure AppSys() for further information. 
   CenterControl( SetAppWindow() ) 

   // Create an XbpMLE object and center it within 
   // the XbpCrt window. Note that the position 
   // of the object is omitted in the call to 
   // :new() and :create(), as the object is about 
   // to be positioned using CenterControl() 
   // anyway 
   oMLE := XbpMLE():new():create( ,,,{300,200} ) 
   CenterControl( oMLE ) 

   WAIT 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.