move

move(x:      Real;
     y:      Real;
     width:  Real;
     height: Real);

The move method of the Window class enables logic to move and size a form or control from a single method call.

The position values for a control are in units, determined by the scaleMode property of the parent control. Form units are in pixels. The resize or formMove event for a form is not generated when the move method is called.

It is far more efficient to call the move method than to set more than one of the left, top, width, height, clientWidth, or clientHeight properties, as each change to these properties results in a call to the move method, changing only a specific property.

Each call potentially results in a move and resize taking place. If the window being affected has other controls aligned to it, these are also resized or moved each time.

The following examples show the use of the move method.

if global.appCount = 1 then
    self.move(0, 0, self.width, self.height);
    label3.backColor := Yellow;
    bOpen.value      := true;
else
    self.move(400, 0, self.width, self.height);
    label3.backColor := Red;
    bListen.value    := true;
endif;

pictureEnlarged_mouseMove(pict: Picture input; button: Integer;
                          shift: Integer; x: Real; y: Real) updating;
begin
    if movePic = true then
        pictureEnlarged.move(pictureEnlarged.left + (x - moveX),
                             pictureEnlarged.top + (y - moveY),
                             pictureEnlarged.width,
                             pictureEnlarged.height);
        pictureEnlarged.refreshNow;
    endif;
end;