Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

Iteraing through controls

Hi

I would like to iterate through a bunch of Panel controls I have on a Windowes form in VB.NET 2003. How can I do this? I'm currently using the following code but it's giving me an error:

Dim oPanel As Panel

For Each oPanel In Me.Controls
     'Some code
Next

Thanks
0
SETP
Asked:
SETP
1 Solution
 
AlexFMCommented:
       Dim oPanel As Panel
        Dim oControl As Control

        For Each oControl In Me.Controls
            If TypeOf oControl Is Panel Then
                oPanel = CType(oControl, Panel)
                ' use oPanel here
            End If
        Next
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now