Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 5 - Control Manager / Control Manager Reference
Control Manager Routines / Changing Control Settings and Display


MoveControl

To move a control within its window, you can use the MoveControl procedure.

PROCEDURE MoveControl (theControl: ControlHandle; 
                       h: Integer; v: Integer);
theControl
A handle to the control you wish to move.
h
The horizontal coordinate (local to the control's window) of the new location of the upper-left corner of the control's rectangle.
v
The vertical coordinate (local to the control's window) of the new
location of the upper-left corner of the control's rectangle.
DESCRIPTION
The MoveControl procedure moves the control to the new location specified by the h and v parameters, using them to change the rectangle specified in the contrlRect field of the control's control record. When the control is visible, MoveControl first hides it and then redraws it at its new location.

For example, if the user resizes a document window that contains a scroll bar, your application can use MoveControl to move the scroll bar to its new location.

SEE ALSO
Listing 5-24 on page 5-61 illustrates the use of MoveControl to change the location of a scroll bar.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996