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 FRAMES1

Project Structure


FRAMES1.DPR

program Frames1;

uses
  Forms,
  Form in 'Form.pas' {Form1},
  Frame in 'Frame.pas' {Frame1: TFrame};

{$R *.RES}

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

FORM.PAS

unit Form;

interface

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

type
  TForm1 = class(TForm)
    Frame11: TFrame1;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

end.

FRAME.PAS

unit Frame;

interface

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

type
  TFrame1 = class(TFrame)
    EditList: TEdit;
    ListList: TListBox;
    btnAdd: TButton;
    btnDelete: TButton;
    procedure btnAddClick(Sender: TObject);
    procedure btnDeleteClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.DFM}

procedure TFrame1.btnAddClick(Sender: TObject);
begin
  if EditList.Text <> '' then
    ListList.Items.Add (EditList.Text);
end;

procedure TFrame1.btnDeleteClick(Sender: TObject);
begin
  if ListList.ItemIndex >= 0 then
    ListList.Items.Delete (ListList.ItemIndex);
end;

end.

FORM.DFM

object Form1: TForm1
  Left = 434
  Top = 123
  Width = 320
  Height = 284
  Caption = 'Frames1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  inline Frame11: TFrame1
    Left = 16
    Top = 24
  end
end

FRAME.DFM

object Frame1: TFrame1
  Left = 0
  Top = 0
  Width = 266
  Height = 197
  TabOrder = 0
  object EditList: TEdit
    Left = 8
    Top = 8
    Width = 169
    Height = 21
    TabOrder = 0
  end
  object ListList: TListBox
    Left = 8
    Top = 32
    Width = 169
    Height = 161
    ItemHeight = 13
    TabOrder = 1
  end
  object btnAdd: TButton
    Left = 184
    Top = 56
    Width = 75
    Height = 25
    Caption = '&Add'
    TabOrder = 2
    OnClick = btnAddClick
  end
  object btnDelete: TButton
    Left = 184
    Top = 88
    Width = 75
    Height = 25
    Caption = '&Delete'
    TabOrder = 3
    OnClick = btnDeleteClick
  end
end