Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window List in MDI Application 2

Status
Not open for further replies.

TimSNL

Programmer
Sep 11, 2001
119
AU
How do I get a list of the Child windows open in an MDI application?

I need to know if a certain window is open and if the user openes it again from the menu just bring this one to the front again.
Also need a list of windows open in the "Windows" menu so you can select them from there and have them come to the front.

The 'MDI Application' that comes from the delphi wizard does all this but I'm not sure how it does it.

Any suggestions or links to the answer?

Thanksfor your help
Tim
 
Create a Menu Item called 'Windows' and in the main form object inspector set the 'Windowmenu' property to point to this'.
create sub menus to the window menu: 'Tile' 'cascade' 'arrange'
with these methods attached if you need them :-

procedure TForm.Tile1Click(Sender: TObject);
begin
Tile;
end;

procedure TForm.Cascade1Click(Sender: TObject);
begin
Cascade;
end;

procedure TForm.Arrange1Click(Sender: TObject);
begin
ArrangeIcons;
end;

The names of any open child windows will get added to the window menu automaticaly. Clicking on one of these will bring the window to the front also automatic!
This will only work if your main form formstyle is set to FSMdiform and your child forms to FSMDIchild.

Hope this helps Steve.

 
Thanks for your help Steve. [medal]

And I found these links to articles:
MDI DEVELOPMENT IN DELPHI. (Part I & Part II)

These look like they will be useful:
+ MDIChildCount
+ MDIChildren
+ ActiveMDIChild

With code like this ...
Code:
var

  I: Integer;
begin
  with Form1 do
    for I := MDIChildCount-1 downto 0 do
      MDIChildren[I].Close;

end;

Hope this info is helpful to someone else as well. [yoda]

Tim
SNL Computing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top