Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:53 pm
by T Moore >> Tue, 19 Apr 2005 7:48:55 GMT
You can get the list of forms open using the Application::forms and Application::formsCount methods on the application class. You will need to check the Form::getMDIFrame method to find the forms that are children of the current frame. For example a method on the MDI Frame. Note you may need to exclude the form just closed.
vars
form : Form;
indx : Integer;
iChildCount : Integer;begin
foreach indx in app.formsCount to 1 step -1 do
form := app.forms(indx);
if form.getMdiFrame=self then
// Form is an MDI child of this frame.
iChildCount := iChildCount + 1;
endif;
endforeach;
end;
You could also create an inverse relationship between the MDIFrame and the MDIChild forms. When the MDI child is opened it could set it's MDIFrame reference. Then the count of child forms would simply be the size of the collection.
Torrie