nerdalert1
Programmer
Is there a way without looping through all the controls on a form to make the whole form read only? Thanks all
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
dim ctl as control
for each ctl in me.ctl
'use reflection to determin object type
'set readonly/enabled respectively
next
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.GetType.GetMember("ReadOnly").GetUpperBound(0) = 0 Then
CallByName(ctl, "ReadOnly", CallType.Set, "True")
ElseIf ctl.GetType.GetMember("Enabled").GetUpperBound(0) = 0 Then
CallByName(ctl, "enabled", CallType.Set, "False")
End If
Next