Livecode Wiki

Specifies whether the user can move a control.


set the lockLocation of <object> to {true | false}


set the lockLocation of button "Next" to true
set the lockLocation of group ID 4455 to false

If the lockLocation property of an object is false, the user can drag its handles with the Pointer tool to move or resize the object . If the object's lockLocation is true, the user cannot move it or resize it.

If the lockLocation of a player or image that references an external file is false, the image or player is resized to fit its contents whenever the card opens. If the lockLocation is true, the image retains whatever size you set, even if it's not the same size as the object's contents.

If the lockLocation of a group is false, the group is automatically resized when the objects in it are moved, resized, hidden, or shown. If the lockLocation is true, this automatic resizing does not occur, and objects that move outside the group's boundaries are not shown. If a group has a scrollbar, set its lockLocation to true to ensure that the group does not automatically resize to fit its contents.

If a control's lockLocation property is false, when you change its height, it shrinks or grows from the center: the control's top and bottom edges both shift, while its location property stays the same. If the control's lockLocation property is true, it shrinks or grows from the top left corner: the control's top edge stays in the same place, and the bottom edge moves.

Changing a control's width or height in the property inspector always preserves its location, regardless of the lockLocation setting.

The setting of the lockLocation property does not prevent a handler from moving or resizing an object.

See also: control (object),height (property),lockCursor (property),lockLocation (property),width (property),location (property),