community.borland.com

Article #16243: TForm.MDIChildren[] Array and Form Creation

 Technical Information Database

TI1243D.txt   TForm.MDIChildren[] Array and Form Creation
Category   :VCL
Platform    :All
Product    :Delphi  All

Description:
The documentation of TForm.MDIChildren[] states that the index
of the first-created MDI child is 0.  This is incorrect -- the
index of the most-recently-created MDI child is always 0, and
the index of the first-created MDI child is always
MDIChildCount - 1.

With this in mind, you can use the following code to iterate
over the MDI child array from from the first-created to the
last:

procedure TForm1.IterateOverMDIChildren;
var
  i: integer;
begin
  for i := MDIChildCount - 1 downto 0 do begin
    { do something with MDI child here }
  end;
end;

Reference:


7/16/98 4:34:06 PM
 

Last Modified: 01-SEP-99