From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Property (As Boolean )
aDesktopUIControl.LockTop = newBooleanValue
BooleanValue = aDesktopUIControl.LockTop

New in 2021r3

Supported for all project types and targets.

Determines whether the top edge of the control should stay at a set distance from the top edge of the parent control, if there is one, or the owning window.


LockTop and LockLeft default to True when you add a control to a window. Existing controls will be altered only if LockRight and/or LockBottom are not set. LockTop has no effect unless LockBottom is True.


This property can be set in the control's Inspector. The following example sets it in code.

Me.LockTop = True