home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Programming Unleashed
/
Delphi_Programming_Unleashed_SAMS_Publishing_1995.iso
/
chap06
/
hello
/
main.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-03-20
|
1KB
|
58 lines
unit Main;
{ Program copyright (c) 1994 by Charles Calvert }
{ Project Name: HELLO }
{ This program shows how to retrieve strings
from an edit control and to then perform
simple operations on the strings you retrieve.
It also shows how to close a form in response
to clicks on a button. }
interface
uses
WinTypes, WinProcs,
Classes, Graphics,
Controls, Forms, StdCtrls;
type
THelloForm = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
BOk: TButton;
LEnterName: TLabel;
BConfirm: TButton;
procedure BOkClick(Sender: TObject);
procedure BConfirmClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
end;
var
HelloForm: THelloForm;
implementation
{$R *.DFM}
procedure THelloForm.BOkClick(Sender: TObject);
begin
Close;
end;
procedure THelloForm.BConfirmClick(Sender: TObject);
var
Name: String;
begin
Name := Edit1.Text;
Edit2.Text := 'You entered: ' + Name;
end;
procedure THelloForm.FormCreate(Sender: TObject);
begin
Edit1.Text := '';
Edit2.Text := '';
end;
end.