troubleshooting Question

VB.net Clear All TextBoxes in each GroupBox on each TabPage

Avatar of Rocker4500
Rocker4500Flag for United Kingdom of Great Britain and Northern Ireland asked on
Programming.NET ProgrammingVisual Basic.NET
1 Comment1 Solution8651 ViewsLast Modified:
This is in addition to another question i posted https://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22922429.html?cid=239

I wanted to clear all the text boxes on each tab page with in the tab control.  I have done this, so i now have the following:

        Dim ctl As Object

        For Each tp As TabPage In tabs.TabPages
            For Each ctl In tp.Controls
                If TypeOf ctl Is TextBox Then
                    ctl.Text = ""
                ElseIf TypeOf ctl Is CheckBox Then
                    ctl.checked = False
                ElseIf TypeOf ctl Is ComboBox Then
                    ctl.SelectedIndex = -1
                End If
            Next
        Next

However, i have now added GroupBoxes to some tabs which within the contain textboxes.  So i now want to clear all the text boxes in the tab pages but also in the group boxes with in the tab pages too.

How do i modify this code to do this?

gary
ASKER CERTIFIED SOLUTION
Mike Tomlinson
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros