unit ArrangeIcons;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus;

type
  TForm1 = class(TForm)
    MainMenu1: TMainMenu;
    MyArrangeIcons: TMenuItem;
    MyCascade: TMenuItem;
    procedure MyArrangeIconsClick(Sender: TObject);
    procedure MyCascadeClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: ArrangeIcons
// Method: Forms.TForm.ArrangeIcons
// Event: Menus.TMenuItem.OnClick
// Property: Forms.TCustomForm.FormStyle

// BeginCode
{
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 MyArrangeIcons. This is code for the
MyArrangeIconsClick handler.  When the user chooses the
ArrangeIcons command, minimized child forms are arranged
so that they are evenly spaced and don't overlap.  DO NOT
name the menu items "ArrangeIcons" as that will override
the TForm method.
} 
procedure TForm1.MyArrangeIconsClick(Sender: TObject);
begin
  Form1.ArrangeIcons;
end;
// EndCode
// EndExample: ArrangeIcons

// BeginExample: Cascade
// Method: Forms.TForm.Cascade

// BeginCode
{
This example uses several forms. The first form has its
FormStyle property set to fsMDIForm. The others have their
FormStyle properties set to fsMDIChild and their Visible
properties set to true. Add a main menu component and name
one of the menu items MyCascade. This is code for the
MyCascadeClick handler.  When the user chooses the
Cascade command, restored forms are arranged
so that they overlap.  DO NOT name the menu items "Cascade"
as that will override the TForm method.
} 
procedure TForm1.MyCascadeClick(Sender: TObject);
begin
  Form1.Cascade;
end;
// EndCode
// EndExample: Cascade
end.
