views:

93

answers:

2

In an Delphi MDI application i can use the Tile,Cascade and ArrangeIcons procedures to organize my child windows, this methods only works when the FormStyle property is set to fsMDIForm, How i can produce the same effect in an SDI application, i mean how i can organize my open windows in a non MDI application?

+1  A: 

You would have to organize them manually by looping through the TScreen::Forms[] list adjusting the Left/Top properties as needed.

Remy Lebeau - TeamB
I second the answer from Remy and want to note that if you support multiple monitors that you also take a look at TScreen.Monitors[]. Not terribly complicated but you should be aware of the implications. Especially if you want to make the window positions persistent between program sessions. E.g. what if the user restarts the program with another monitor configuration (one instead of two monitors, Laptop docked at home has two screens... on the road only one...)
Christian
+3  A: 

Usually, you don't have to. Users who wish to re-arrange the windows can right-click the taskbar and choose the tile and cascade commands from the context menu. And I've seen TV commercials for Windows 7 showing that you can even just drag windows in a certain way to make them arrange themselves.

If you still want to provide the command yourself, use the TileWindows and CascadeWindows API functions.

Rob Kennedy