BenRosa
Member
Greetings:
The below code complies w/o error, however, upon running it the above error msg is generated (by second line in below code). Thing is, Im not sure why as Im defining the variable as a type that is in the collection. (The routine is for making all child panels on a main panel invisible upon initial load.)
Any and all guidance will be appreciated.
Private Sub HideAllPanels(ByVal ThePanel As Panel)
For Each ControlObj As Panel In ThePanel.Controls
If ControlObj.GetType.ToString() = "Panel" Then
ControlObj.Visible = False
If ControlObj.Controls.Count > 0 Then
HideAllPanels(ControlObj)
End If
End If
Next
End Sub
Ed in Tampa
The below code complies w/o error, however, upon running it the above error msg is generated (by second line in below code). Thing is, Im not sure why as Im defining the variable as a type that is in the collection. (The routine is for making all child panels on a main panel invisible upon initial load.)
Any and all guidance will be appreciated.
Private Sub HideAllPanels(ByVal ThePanel As Panel)
For Each ControlObj As Panel In ThePanel.Controls
If ControlObj.GetType.ToString() = "Panel" Then
ControlObj.Visible = False
If ControlObj.Controls.Count > 0 Then
HideAllPanels(ControlObj)
End If
End If
Next
End Sub
Ed in Tampa