Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click GetAllControls(Me) End Sub
Private Sub GetAllControls(ByVal control As Control) If control.HasChildren Then For Each childControl As Control In control.Controls GetAllControls(childControl) ' Debug.WriteLine(childControl.Name) 'テキストボックスだけにアクセスしたい場合 If TypeOf childControl Is TextBox Then If childControl.Name = "TextBox3" Then '特定のテキストボックスを除外する場合を Else childControl.Text = "" End If End If Next childControl End If End Sub