Thank you for the help. I tried your suggested code and sadly it only reiterated the Tab control. I made a couple more searches using the list method you mentioned and found a set of code here which accomplishes what I needed.
Unfortunately, I'm not too familiar with using lists. Can you help explain the code to me so I can get a better understanding of it? The gist, if I'm not mistaken, is that the GetChildren() sub gets all of the controls in the active form and lists them down, checks if it has child controls and calls the same sub from within the sub (this is what recursive means, yes?) until such time that the parent control no longer has any child controls?Code:Dim _list As New List(Of Control) Public Sub GetChildren(container As Control) For Each child As Control In container.Controls _list.Add(child) If (child.HasChildren) Then GetChildren(child) End If Next End Sub Public Sub CheckIndexes() GetChildren(Me) For Each ctrl As Control In _list If ctrl.GetType.Name = "ComboBox" Then If CType(ctrl, ComboBox).SelectedIndex = -1 Then HighlightError(ctrl, errMissing) blnMissing = True End If End If Next End Sub
Also, what's the significance of the _ in _list? Is this a naming convention pertaining to something?




Reply With Quote