Skip to content

Instantly share code, notes, and snippets.

@wolf99
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolf99/1c9aff8232e409972487 to your computer and use it in GitHub Desktop.
Save wolf99/1c9aff8232e409972487 to your computer and use it in GitHub Desktop.
Change the enabled state of all VB.NET form controls of type T
Private Sub ChangeFormControlEnabledState(Of T As Control)(f As Form, state As Boolean)
Dim c As Control
For Each c In f.Controls
If TypeOf c Is T Then
CType(c, T).Enabled = state
End If
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment