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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Windows Name ?

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
US
I am using a lof of MDIchild window in my application. I would like to be able to switch from one another by checking the its window name under the windows menu where i have, cascade, tile and arrange icons.
How would I do that?
Thanks.
PO
 
Originally from:

MDI parent form Main Menu, again
The Window menu of an MDI application should also include a list of the MDI child windows. As everything in Delphi, this is easy to accomplish. Assume that we have a menu item named ChildList on a MDI form. To add the list of MDI child windows, set:
Code:
frMain.WindowMenu := ChildList;
Delphi will automatically display the list of the MDI child form captions, and even put a check mark next to the one that most recently was active.

Note: In Delphi 5, there is a known bug with WindowMenu property (captions won't display). Work around: set AutoHotkeys and AutoLineReduction properties to maManual, the maAutomatic value seems to interfere with the way Windows handles the Window menu in MDI apps. For some reason if you have a separator on that menu, it won't work at all (from what I remember) and the list gets a little weird when you change the form's caption at runtime, the MDI children disappear until another form is made.
 
Thanks. I downloaded the code. His code does not show the list of mdi window. I tried to add the frmain.windowmenu:=childlist in the formcreate event but that did not work.
Do you know where I should add the frmain.windowmenu:=childlist?
Thanks.
 
Ah - even easier.

Set the Parent Form's WindowMenu property to the menu item where you want Delphi to track the list for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top