Locked

This property returns and sets a value that indicates whether a control can be edited.

Syntax

object.Locked [= Boolean]

Parameters

object
Object expression that evaluates to a TextBox or ComboBox control.
Boolean
Boolean expression that specifies whether the control can be edited. Following are the settings for Boolean:
True
TextBox control. You can scroll and highlight the text in the control, but you cannot edit it. However, you can modify the text by changing the Text property.

ComboBox object. You cannot type in the text box.

False
TextBox control. You can edit the text in the control.

ComboBox object. You can type in the text box, and you can open the drop-down list box.

Remarks

For the ComboBox control, when Locked is set to True, a user cannot change any data. However, a user can highlight data in the text box and copy it. This property does not affect programmatic access to the ComboBox.