计算器(加了个小数点)。。。
2008-04-09 04:21:22来源:互联网 阅读 ()
unit jisuanqiU;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
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;
Panel1: TPanel;
Edit1: TEdit;
Button17: TButton;
Button16: TButton;
Button18: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button12Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure Button15Click(Sender: TObject);
procedure Button17Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Button18Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
// num,num1,num2:integer;
s,j,i,s_number,s_type,s_characterlast:string;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if s_type=''''1'''' then begin
edit1.Text:=edit1.Text ''''1'''';
s:=''''123''''; end
else begin
edit1.text:='''''''';
edit1.text:=edit1.Text ''''1'''';
s_type:=''''1'''';
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if s_type=''''1'''' then begin
edit1.Text:=edit1.Text ''''2'''';
s:=''''123''''; end
else begin
edit1.text:='''''''';
edit1.text:=edit1.Text ''''2'''';
s_type:=''''1'''';
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
if s_type=''''1'''' then begin
edit1.Text:=edit1.Text ''''3'''';
s:=''''123''''; end
else begin
edit1.text:='''''''';
edit1.text:=edit1.Text ''''3'''';
s_type:=''''1'''';
end;;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
if s_type=''''1'''' then begin
edit1.Text:=edit1.Text ''''4'''';
s:=''''123''''; end
else begin
edit1.text:='''''''';
edit1.text:=edit1.Text ''''4'''';
s_type:=''''1'''';
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if s_type=''''1'''' then begin
edit1.Text:=edit1.Text ''''5'''';
s:=''''123''''; end
else begin
edit1.text:='''''''';
edit1.text:=edit1.Text ''''5'''';
s_type:=''''1'''';
end;
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
if s_type=''''1'''' then begin
edit1.Text:=edit1.Text ''''6'''';
s:=''''123''''; end
else begin
edit1.text:='''''''';
edit1.text:=edit1.Text ''''6'''';
s_type:=''''1'''';
end;
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
if s_type=''''1'''' then begin
edit1.Text:=edit1.Text ''''7'''';
s:=''''123''''; end
else begin
edit1.text:='''''''';
edit1.text:=edit1.Text ''''7'''';
s_type:=''''1'''';
end;
end;
procedure TForm1.Button8Click(Sender: TObject);
begin
if s_type=''''1'''' then begin
edit1.Text:=edit1.Text ''''8'''';
s:=''''123''''; end
else begin
edit1.text:='''''''';
edit1.text:=edit1.Text ''''8'''';
s_type:=''''1'''';
end;
end;
procedure TForm1.Button9Click(Sender: TObject);
begin
if s_type=''''1'''' then begin
edit1.Text:=edit1.Text ''''9'''';
s:=''''123''''; end
else begin
edit1.text:='''''''';
edit1.text:=edit1.Text ''''9'''';
s_type:=''''1'''';
end;
end;
procedure TForm1.Button10Click(Sender: TObject);
begin
if s_type=''''1'''' then begin
edit1.Text:=edit1.Text ''''0'''';
s:=''''123''''; end
else begin
edit1.text:='''''''';
edit1.text:=edit1.Text ''''0'''';
s_type:=''''1'''';
end;
end;
procedure TForm1.Button12Click(Sender: TObject);
begin
s_type:=''''0'''';
if s='''''''' then
application.MessageBox(''''请先输入数字'''',''''提示:'''',0)
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash