Marco Web Center |
Home: Code Repository: Mastering Delphi 5Project FRAMES1
Project StructureFRAMES1.DPRprogram 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.PASunit 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.PASunit 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.DFMobject 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.DFMobject 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
|
||
© Copyright Marco Cantù, 1995-2020, All rights reserved |