On Jan 24, 2007, at 11:48 AM, GregO wrote:

Anyone know if there's a way to get a list (or array) of the children of a control? For example, If I have a groupbox and want to get a list of all of the controls that are within that control? I know I can go in the other direction and get the parent's of each control in the window, but how do I go from parents to children?


Function Children(extends r as RectControl) as RectControl()
  dim theChildren(-1) as RectControl
  if r.Window is nil then
    return theChildren
  end if

  dim lastControl as Integer = r.Window.ControlCount - 1
  for i as Integer = 0 to lastControl
if r.Window.Control(i) IsA RectControl and RectControl (r.Window.Control(i)).Parent is r then
      theChildren.Append r.Window.Control(i)
    end if
  next
  return theChildren
End Function


Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to