RAD Studio VCL Reference
|
Provides indexed access to all MDI child forms.
property MDIChildren [I: Integer]: TForm;
__property TForm * MDIChildren[int I];
Use MDIChildren to access a child form.
I is the index of the child form to access. The order of MDI children changes as different MDI forms are activated. Initially, forms are listed in creation order, with new forms being added to the end of the array. Whenever an MDI child is activated, however, it moves to the front of the list. Thus, use I to index over all forms in the array, but not to refer to a specific form.
MDIChildren is meaningful only if the form is an MDI frame (that is, if the form's FormStyle property is set to fsMDIForm).
Delphi Examples:
{ This example uses several forms. The first form has its FormStyle property set to MDIForm. The others have their FormStyle properties set to MDIChild and their Visible properties set to true. Add a main menu component and name one of the menu items CloseChildren. This is code for the CloseChildrenClick handler. When the user chooses the CloseChildren command, all the MDI children of Form1 are closed. } procedure TForm1.CloseChildrenClick(Sender: TObject); var I: Integer; begin with Form1 do for I := MDIChildCount-1 downto 0 do MDIChildren[I].Close; end; procedure TForm1.MyArrangeIconsClick(Sender: TObject); begin Form1.ArrangeIcons; end; procedure TForm1.MyCascadeClick(Sender: TObject); begin Form1.Cascade; end;
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|