home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
delphi
/
prctvb25.lzh
/
DELPHI.ZIP
/
UNIT1.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1996-01-20
|
2KB
|
97 lines
unit Unit1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, Menus, StdCtrls, VBXCtrl, Prcnt25;
type
TForm1 = class(TForm)
Prcnt1: TPrcnt;
Prcnt2: TPrcnt;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Edit1: TEdit;
Edit2: TEdit;
MainMenu1: TMainMenu;
Exit1: TMenuItem;
procedure Exit1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Prcnt1Change(Sender: TObject);
procedure Prcnt2Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
procedure Edit1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
S: String[15];
value: Real;
Code: Integer;
implementation
{$R *.DFM}
procedure TForm1.Exit1Click(Sender: TObject);
begin
Halt;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
value := Prcnt1.percent;
Str(value:6:2,S);
edit2.text := S;
value := Prcnt2.value;
Str(value:6:2,S);
edit1.text := S;
end;
procedure TForm1.Prcnt1Change(Sender: TObject);
begin
value := Prcnt1.percent;
Str(value:6:2,S);
edit2.text := S;
end;
procedure TForm1.Prcnt2Change(Sender: TObject);
begin
value := Prcnt2.value;
Str(value:6:2,S);
edit1.text := S;
end;
procedure TForm1.Edit2Change(Sender: TObject);
begin
Val(Edit2.Text, value, Code);
prcnt1.percent := value;
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
Val(Edit1.Text, value, Code);
prcnt2.value := value;
end;
end.