Hoşgeldin, Ziyaretçi:

Üye Ol
Yeni Tema ! Yeni temamız forumumuza hayırlı olsun.Bu konuda fikirlerinizi beyan edebilirsiniz.
Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
Delphİ Hesap Makinesi Programı (Kodları)
#1
Formumuza 17 Buton Eklıyoruz ve 1 de edıt

kod:


Kod:
unit Unit1;

interface

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

type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Button12: TButton;
Button13: TButton;
Button14: TButton;
Button15: TButton;
Button16: TButton;
Button17: TButton;
procedure Button9Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure Button17Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button12Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure Button15Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
secim: Integer;
sayi1: Integer;
Sayi2: Integer;
sonuc: Real;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.Button9Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+"7";
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+"1";
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+"2";
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+"3";
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+"4";
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+"5";
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+"6";
end;

procedure TForm1.Button10Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+"8";
end;

procedure TForm1.Button11Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+"9";
end;

procedure TForm1.Button17Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+"0";
end;

procedure TForm1.Button14Click(Sender: TObject);
begin
sayi1:=StrToInt(Edit1.Text);
secim:=1;
Edit1.Text:=";
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
sayi1:=StrToInt(Edit1.Text);
secim:=2;
Edit1.Text:=";
end;

procedure TForm1.Button8Click(Sender: TObject);
begin
sayi1:=StrToInt(Edit1.Text);
secim:=3;
Edit1.Text:=";
end;

procedure TForm1.Button12Click(Sender: TObject);
begin
sayi1:=StrToInt(Edit1.Text);
secim:=4;
Edit1.Text:=";
end;

procedure TForm1.Button13Click(Sender: TObject);
begin
sayi2:=StrToInt(Edit1.Text);
if secim = 1 Then sonuc:= sayi1+sayi2;
if secim = 2 Then sonuc:= sayi1-sayi2;
if secim = 3 Then sonuc:= sayi1*sayi2;
if secim = 4 Then sonuc:= sayi1/sayi2;
Edit1.Text:= FloatToStr(sonuc);
end;

procedure TForm1.Button15Click(Sender: TObject);
begin
Edit1.Clear;
end;


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
  Delphi form açılışına şifre koymak Kim-Jong 0 190 09-07-2015, Saat: 09:34
Son Yorum: Kim-Jong
  Delphi'de 100'den 0'a Geri Sayım Kim-Jong 0 220 09-07-2015, Saat: 09:33
Son Yorum: Kim-Jong
  Delphi Dosya Silme Kodu Kim-Jong 0 182 09-07-2015, Saat: 09:32
Son Yorum: Kim-Jong

Hızlı Menü:


Konuyu Okuyanlar: 1 Ziyaretçi

Türkçe Çeviri:MCTR MyBB, © 2002-2016 MyBB Group.
Desing and Coding By Mustafa SEVİM