Torna al Thread
Private Sub Abilita(ByVal MioForm As Control, ByVal nome1 As String, ByVal nome2 As String)
For Each ctrl As Control In MioForm.Controls
If ctrl.HasChildren Then
Abilita(ctrl, nome1, nome2)
End If
If ctrl.Name.Contains(nome1) Or ctrl.Name.Contains(nome2) Then
ctrl.Enabled = True
End If
If TypeOf ctrl Is ToolStrip Then
Dim tipo As ToolStrip = CType(ctrl, ToolStrip)
For i As Integer = 0 To tipo.Items.Count - 1
If tipo.Items.Item(i).Name.Contains(nome1) Or tipo.Items.Item(i).Name.Contains(nome2) Then
tipo.Items.Item(i).Enabled = True
End If
Next
End If
Next
End Sub