External Interfaces Reference Previous page   Next Page
move

Move or resize control in parent window

Syntax

Description

V = h.move(position) moves the control to the position specified by the position argument. When you use move with only the handle argument, h, it returns a four-element vector indicating the current position of the control.

V = move(h, position) is an alternate syntax for the same operation.

The position argument is a four-element vector specifying the position and size of the control in the parent figure window. The elements of the vector are

where x and y are offsets, in pixels, from the bottom left corner of the figure window to the same corner of the control, and width and height are the size of the control itself.

Examples

This example moves the control:

The next example resizes the control to always be centered in the figure as you resize the figure window. Start by creating the script resizectrl.m that contains

Now execute the following in MATLAB or in an M-file:

As you resize the figure window, notice that the circle moves so that it is always positioned in the center of the window.

See Also

set, get


Previous page  load (COM) propedit Next page

© 1994-2005 The MathWorks, Inc.