Getting Form's Child Form

G

Guest

Is there a way to get a form's child form?

We have a mdi container app that launch forms inside it. These forms may
have child forms (done via the old Win32 SetParent() function). I want to
loop through all my forms in my app and see if they have any child forms.
Can't seem to find a way/method that will do that, even old Win32, which I
have forgotten.

Thanks,

Rich Sienkiewicz
DragonPoint Software
(e-mail address removed)
 
S

Stoitcho Goutsev \(100\)

Hi,
These forms may
have child forms (done via the old Win32 SetParent() function).

Form is WindowsForms term; from Windows OS point of view there are windows
of some particular style - overlapped, popup and child.
When you say that you use Win32 SetParent function I assume that you are
talking about native winodws rather than .NET forms or controls. If this is
the case you can enumerate them only using API. WindowsForms classes can
enumerate only WindowsForms controls. Win32 window enumeration functions
will enumerate native windows that means it will pick up native windows
attached to .NET controls also. For such windows you can get the
corresponding WindowsForms object using Control.FromHandle or
Control.FromChildHandle, but for windows created using Win32 API this is not
possible simply because such objects don't exist.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top