Logo New book: Delphi 2007 Handbook
My blog in online
Delphi tech support service: support.marcocantu.com
Google
  Web www.marcocantu.com

Menu for Development

Site Menu
Delphi 2007 Handbook
Mastering Borland Delphi 2005
Essential Pascal
Essential Delphi
Buy Books Online
Code Repository
Newsgroups
White Papers
Tools
Conferences
Training
Delphi Links
Contact Marco

My Other Sites
Italian Site (www.marcocantu.it)
Developers Newsgroups Browser (dev.newswhat.com)
My town (www.piazzacavalli.net)
the delphi search
Wintech Italia (my company)

Breaking News
Buy Mastering Borland Delphi 2005 from Amazon
Free ebook: Mastering Delphi Update for Delphi 2006

Advertising
Home My Blog Books My Bookstore Development Links Marco



Home: Code Repository: Mastering Delphi 5

Project BORDERS

Project Structure


BORDERS.DPR

program Borders;

uses
  Forms,
  BordersF in 'BordersF.pas' {Form1},
  Second in 'Second.pas' {Form2};

{$R *.RES}

begin
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.Run;
end.

BORDERSF.PAS

unit BordersF;

interface

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

type
  TForm1 = class(TForm)
    BtnNewForm: TButton;
    BorderRadioGroup: TRadioGroup;
    procedure BtnNewFormClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

uses
  Second;

procedure TForm1.BtnNewFormClick(Sender: TObject);
var
  NewForm: TForm2;
begin
  NewForm := TForm2.Create (Application);
  NewForm.BorderStyle := TFormBorderStyle (
    BorderRadioGroup.ItemIndex);
  NewForm.Caption := BorderRadioGroup.Items[
    BorderRadioGroup.ItemIndex];
  NewForm.Show;
end;

end.

SECOND.PAS

unit Second;

interface

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

type
  TForm2 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.DFM}

end.

BORDERSF.DFM

object Form1: TForm1
  Left = 210
  Top = 103
  Width = 291
  Height = 197
  Caption = 'Borders'
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  PixelsPerInch = 96
  TextHeight = 13
  object BtnNewForm: TButton
    Left = 192
    Top = 16
    Width = 75
    Height = 25
    Caption = 'New Form'
    TabOrder = 0
    OnClick = BtnNewFormClick
  end
  object BorderRadioGroup: TRadioGroup
    Left = 8
    Top = 8
    Width = 169
    Height = 153
    Caption = ' Border '
    ItemIndex = 2
    Items.Strings = (
      'None'
      'Single'
      'Sizeable'
      'Dialog'
      'Tool Window'
      'Sizeable Tool Window')
    TabOrder = 1
  end
end

SECOND.DFM

object Form2: TForm2
  Left = 210
  Top = 144
  Width = 250
  Height = 100
  Caption = 'Form2'
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  PixelsPerInch = 96
  Position = poDefaultPosOnly
  TextHeight = 13
end