I have a form with a \"Clear\" button.
When the user clicks \"Clear\", I want to clear the value of all the visible elements on the form. In the case of date contro
This May Help in Future Development ...
GetAllButtons(Me)
Public Sub GetAllButtons(ByRef forms As Object)
Dim list As New List(Of Button)
Dim iIndx As Integer
For Each c In forms.Controls
For iIndx = 0 To forms.Controls.Count - 1
If (TypeOf forms.Controls(iIndx) Is Button) Then
list.Add(forms.Controls(iIndx))
End If
If (TypeOf forms.controls(iIndx) Is Panel) Then
For Each cntrl As Control In forms.controls(iIndx).Controls
If TypeOf cntrl Is Button Then
list.Add(cntrl)
End If
Next
End If
Next
Next
Button(list.ToArray)
End Sub
Public Sub Button(btn() As Button)
For Each bt In btn
Do Something with Buttons
next
End Sub