We help IT Professionals succeed at work.

For Each control in a frame

Nothing99
Nothing99 asked
on
Hi!

It is possible to make a list of all the control in a frame...? Something like this:

Ex.: Dim ctr as control
     For each ctr in myFrame
        msgbox ctr.name
     Next

Thanks!
Comment
Watch Question

Commented:
Not Exactly, Try This..

Dim Ctrl As Control
  For Each Ctrl In Me.Controls
    If Ctrl.Container.Name = MyFrame.Name Then
      Print Ctrl.Name
    End If
  Next
..

Good Luck,
RH.

Commented:
RHuebner is all right

Commented:
.. although "If Ctrl.Container Is MyFrame Then" is probably more efficient than comparing two strings.

Author

Commented:
Thanks!!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.