VLFormDesigner Reference

MethodLockControls

See Also See Also Applies To Applies To

Locks contained controls as specified by the method parameters. User cannot move, resize or align a control that has been marked as locked.

 

Syntax

object.LockControls(ByVal eScope As vlScope, Optional ByVal aControl As Object = Nothing)

 

The LockControls method syntax has these parts:

Part Description
object An object expression that evaluates to VLFormDesigner.
eScope An integer specifying the range of controls that will be locked, as described in Settings.
aControl Optional. aContained control. This parameter will be used only if eScope is specified as vlScopeThis.

 

Settings

The settings for eScope are:

Constant Setting Description
ConstantvlScopeThis 0 Only the control specified by aControl parameter will be marked as locked
ConstantvlScopeSelected 1 All contained controls that as currently selected, will be marked as locked.
ConstantvlScopeAll 2 All contained controls will be marked as locked.

 

Remark

This method along with UnockControls method, allows you to provide control locking / unlocking functionality with different level of scope with just a few lines of code.

When lock scope is vlScopeAll, even those controls that are added after calling LockControls will be locked automatically. This behavior will continue till you unlock atleast one control, or till you again call LockControls with a different scope.