unit CustomForms;

interface

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

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses Unit2;

// BeginExample: CustomForms
// Property: Forms.TScreen.CustomForms
// Property: Forms.TScreen.CustomFormCount

// BeginCode
{
The following code adds the name of all forms and dialogs on
the screen to ListBox1 when Button1 is clicked.
} 
procedure TForm1.Button1Click(Sender: TObject);
var
  I: Integer;
begin
  for I := 0 to Screen.CustomFormCount-1 do
    ListBox1.Items.Add(Screen.CustomForms[I].Name);
end;
// EndCode
// EndExample: CustomForms
end.
