ok, I have several functions of which each clear (initialize) each individual control encountered on a form (textbox, combobox, etc)

They work like a charm UNLESS those controls are on a tab that is on a tab. ex. I have a main tab control and the controls (tabs and its controls) get cleared fine. I have other tab controls sitting on that main one. THOSE tabs and the controls sitting on those aren't getting touched. following are the basic fuctions:


VB Code:
  1. '***************************************************************************************************
  2.         'Initialize the tab pages
  3.  
  4.         For Each ctrl As Control In Me.Controls
  5.             If TypeOf ctrl Is TabControl Then
  6.  
  7.                 ClearTabControl(ctrl)
  8.  
  9.             End If
  10.  
  11.         Next

VB Code:
  1. Public Sub ClearListBox(ByVal box As ListBox)
  2.         'Purpose    :   Clear a list box of all items
  3.         'Accepts    :   listbox control
  4.         'Notes      :  
  5.         box.Items.Clear()
  6.     End Sub
  7.  
  8.     Public Sub ClearTabControl(ByVal tc As TabControl)
  9.         'Purpose    :   clears all tabpages on a tabpage control
  10.         'Accepts    :   control as tabcontrol
  11.         'Returns    :  
  12.         'Notes      :  
  13.  
  14.         For Each ctrl As Control In tc.Controls
  15.             Try
  16.                 If TypeOf ctrl Is TabPage Then
  17.                     ClearTab(ctrl)
  18.                 End If
  19.             Catch ex As Exception
  20.  
  21.             End Try
  22.         Next
  23.  
  24.     End Sub
  25.  
  26.     Public Sub ClearTab(ByVal tab As TabPage)
  27.         'Purpose    :   Clears an entire tab control of data
  28.         'Accepts    :   tabpage control
  29.         'Notes      :   this sub calls on other subs to do the work
  30.  
  31.         For Each ctrl As Control In tab.Controls
  32.  
  33.             Try
  34.                 'Clear all textboxes
  35.                 If TypeOf ctrl Is TextBox Then
  36.                     TextBoxClear(ctrl)
  37.                 End If
  38.  
  39.                 'Next, ComboBoxes
  40.                 If TypeOf ctrl Is ComboBox Then
  41.                     ComboBoxClear(ctrl)
  42.                 End If
  43.  
  44.                 'Next, Groupboxes
  45.                 If TypeOf ctrl Is GroupBox Then
  46.                     GroupBoxClear(ctrl)
  47.                 End If
  48.  
  49.                 'Next, other Tabs
  50.                 If TypeOf ctrl Is TabPage Then
  51.                     ClearTab(ctrl)
  52.                 End If
  53.  
  54.                 'Next, Listboxes
  55.                 If TypeOf ctrl Is ListBox Then
  56.                     ClearListBox(ctrl)
  57.                 End If
  58.             Catch
  59.             End Try
  60.         Next
  61.  
  62.     End Sub
  63.  
  64.     Public Sub ComboBoxClear(ByVal Box As ComboBox)
  65.         'Purpose    :   Resets a combobox to the first item in the collection list
  66.         'Accepts    :   combox as argument
  67.         'Notes      :   This doesn't delete any info, it just resets the box
  68.  
  69.         Try
  70.             Box.Text = Box.Items.Item(0)
  71.  
  72.         Catch
  73.  
  74.         End Try
  75.  
  76.     End Sub
  77.  
  78. Public Sub GroupBoxClear(ByVal groupbox As GroupBox)
  79.         'Purpose    :   Clear all textboxes within a groupbox control
  80.         'Accepts    :   groupbox as argument
  81.         'Notes      :  
  82.  
  83.  
  84.         For Each ctrl As Control In groupbox.Controls
  85.  
  86.             Try
  87.                 If TypeOf ctrl Is TextBox Then
  88.  
  89.                     TextBoxClear(ctrl)
  90.  
  91.                 End If
  92.  
  93.                 If TypeOf ctrl Is ComboBox Then
  94.  
  95.                     ComboBoxClear(ctrl)
  96.  
  97.                 End If
  98.  
  99.             Catch
  100.  
  101.             End Try
  102.  
  103.         Next
  104.  
  105.  
  106.     End Sub
  107.  
  108.  Public Sub TextBoxClear(ByVal box As TextBox)
  109.         box.Text = String.Empty
  110.     End Sub

apparantly, i'm missing something when program control goes to TAB CONTROL .