不知阿珠JD1 大侠是否愿意呢?
小弟在次先谢了!
因为学校这几天在改DNS SO 小弟有些怠慢了。
五年后硅谷的中国人才 小弟 邮箱: aeolusfly.student@ aeolusfly@
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Panel1: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
SpeedButton7: TSpeedButton;
SpeedButton8: TSpeedButton;
SpeedButton9: TSpeedButton;
SpeedButton10: TSpeedButton;
SpeedButton11: TSpeedButton;
SpeedButton12: TSpeedButton;
SpeedButton13: TSpeedButton;
SpeedButton14: TSpeedButton;
SpeedButton15: TSpeedButton;
SpeedButton16: TSpeedButton;
SpeedButton17: TSpeedButton;
procedure SpeedButton15Click(Sender: TObject);
procedure SpeedButton14Click(Sender: TObject);
procedure SpeedButton13Click(Sender: TObject);
procedure SpeedButton12Click(Sender: TObject);
procedure SpeedButton11Click(Sender: TObject);
procedure SpeedButton10Click(Sender: TObject);
procedure SpeedButton9Click(Sender: TObject);
procedure SpeedButton8Click(Sender: TObject);
procedure SpeedButton7Click(Sender: TObject);
procedure SpeedButton6Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton16Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton17Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
s:string;
a:real;
b:integer;
implementation
{$R *.dfm}
procedure TForm1.SpeedButton15Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'1';
end;
procedure TForm1.SpeedButton14Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'2';
end;
procedure TForm1.SpeedButton13Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'3';
end;
procedure TForm1.SpeedButton12Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'4';
end;
procedure TForm1.SpeedButton11Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'5';
end;
procedure TForm1.SpeedButton10Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'6';
end;
procedure TForm1.SpeedButton9Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'7';
end;
procedure TForm1.SpeedButton8Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'8';
end;
procedure TForm1.SpeedButton7Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'9';
end;
procedure TForm1.SpeedButton6Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'0';
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
b:=1;
s:=edit1.Text;
edit1.Clear;
end;
procedure TForm1.SpeedButton5Click(Sender: TObject);
begin
b:=2;
s:=edit1.Text;
edit1.Clear;
end;
procedure TForm1.SpeedButton4Click(Sender: TObject);
begin
b:=3;
s:=edit1.Text;
edit1.Clear;
end;
procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
b:=4;
s:=edit1.Text;
edit1.Clear;
end;
procedure TForm1.SpeedButton16Click(Sender: TObject);
begin
edit1.Clear;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
case b of
1:a:=strtofloat(s)+strtofloat(edit1.text);
2:a:=strtofloat(s)-strtofloat(edit1.text);
3:a:=strtofloat(s)*strtofloat(edit1.text);
4:a:=strtofloat(s)/strtofloat(edit1.text);
end;
edit1.text:=floattostr(a);
end;
procedure TForm1.SpeedButton17Click(Sender: TObject);
begin
edit1.Text:=edit1.Text+'.';
end;
end.