VB Code:
  1. Dim c As Control
  2.  
  3. For Each c In Me.Controls
  4.     If TypeOf c Is Panel Then
  5.         Dim pnl As Panel = DirectCast(c,Panel)
  6.         'Do whatever it is you are doing to pnl
  7.     End If
  8. Next