Re: Loop through controls by Pritcham
Pritcham
Tue Jul 18 06:56:18 CDT 2006
Hi
Something like the following should do:
Private Sub ClearControls(ByVal caller As Object, ByVal lock As
Boolean)
Dim ctl As Control
For Each ctl In caller.Controls
If ctl.HasChildren Then
ClearControls(ctl, lock)
End If
If TypeOf ctl Is Windows.Forms.TextBox Then
ctl.Text = String.Empty
End If
Next
End Sub
Hope that helps
Martin
Inga2005 wrote:
> I have a winform with a number of user controls. On of the control is a
> tab control which contains a number of pages where each page has
> textboxes and other controls on it. I would like to loop through all
> the texboxes on one of the tab pages and empty each and every one of
> them. However, I only manage to loop through the separate tab pages and
> not their content. Any ideas?
> /erik