Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to lock all controls in the form at once 1

Status
Not open for further replies.

kosala1981

Programmer
Apr 10, 2007
17
LK
how to lock set of controls in a form with out specifying one by one. i tried

a for loop. but it didnt work. i couldn't get the Locked property of the

controls.

here is my code:

For x = 0 To Me.Count - 1
If TypeOf Me.Controls(x) Is TextBox Then
Me.Controls(x).Locked = True
ElseIf TypeOf Me.Controls(x) Is ComboBox Then
Me.Controls(x).Locked = True
End If
Next x

the above code gives an error.

how to lock all controls in the form at once. answer would be really

appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top