Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit2;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls;
- type
- TForm2 = class(TForm)
- GroupBox1: TGroupBox;
- CheckBox1: TCheckBox;
- CheckBox2: TCheckBox;
- CheckBox3: TCheckBox;
- Label1: TLabel;
- Edit1: TEdit;
- Button1: TButton;
- Button2: TButton;
- procedure CheckBox1Click(Sender: TObject);
- procedure CheckBox2Click(Sender: TObject);
- procedure CheckBox3Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- procedure Total;
- procedure bersih;
- end;
- var
- Form2: TForm2;
- implementation
- {$R *.dfm}
- procedure TForm2.bersih;
- begin
- CheckBox1.Checked:=False;
- CheckBox2.Checked:=False;
- CheckBox3.Checked:=False;
- Edit1.Clear;
- end;
- procedure TForm2.CheckBox2Click(Sender: TObject);
- begin
- Total;
- end;
- procedure TForm2.CheckBox3Click(Sender: TObject);
- begin
- Total;
- end;
- procedure TForm2.Total;
- var kf,tv,sp,tot:Integer;
- begin
- if CheckBox1.Checked=True then kf:=500000 else kf:=0;
- if CheckBox2.Checked=True then kf:=750000 else kf:=0;
- if CheckBox3.Checked=True then kf:=1500000 else kf:=0;
- tot:=kf+tv+sp;
- edit1.text:=IntToStr(tot);
- end;
- procedure TForm2.CheckBox1Click(Sender: TObject);
- begin
- Total;
- end;
- procedure TForm2.FormCreate(Sender: TObject);
- begin
- Bersih;
- end;
- procedure TForm2.Button1Click(Sender: TObject);
- begin
- bersih;
- end;
- procedure TForm2.Button2Click(Sender: TObject);
- begin
- Close;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement