Board index » delphi » Tracking open child forms in MDI apps

Tracking open child forms in MDI apps

Is there a way to determine if a child form has been loaded in an MDI
app. VB has a forms object which holds this info but I can't find any
reference to a similar object in Delphi.

Altenatively, whats the best way of tracking an expanding and
contracting list of forms.  Is there a variation of the string list?

Thanks
Kym Wilson.

 

Re:Tracking open child forms in MDI apps


Kym -

Quote
>Is there a way to determine if a child form has been loaded in an MDI
>app. VB has a forms object which holds this info but I can't find any
>reference to a similar object in Delphi.

>Altenatively, whats the best way of tracking an expanding and
>contracting list of forms.  Is there a variation of the string list?

The MDI parent form has a property called MDIChildren that is an array of open
MDI child forms.  What do you need to do that this won't handle?

--
Clayton Neff
Software Project Leader
The Personal Marketing Company, Inc.
11843 West 83rd Terrace
Lenexa, KS  66214
(913)492-0322
clay...@tpmco.com

Re:Tracking open child forms in MDI apps


Quote
>>Is there a way to determine if a child form has been loaded in an MDI
>>app. VB has a forms object which holds this info but I can't find any
>>reference to a similar object in Delphi.

procedure TMainForm.ChildOpen: boolean;
var Found: boolean; P: integer; Form: TForm;
begin
        Found:=False;
        P:=0;
        while (not Found) and (P<MDIChildCount) do
        begin
                Form:=MDIChildren[P];
                if Form is TChildForm then
                begin
                        Found:=True;
                        Form.BringToFront
                end
                else
                        Inc(P)
        end
end;

Does that help?

Other Threads