4个回答
展开全部
的源代码,界面你就自己做了
procedure TForm1.FormCreate(Sender: TObject);
begin
button0.Click;
end;
procedure TForm1.Button11Click(Sender: TObject);
begin
if point_flag=false then
begin
input_number(10);
point_flag:=true;
end;
end;
procedure TForm1.Button29Click(Sender: TObject);
begin
s_source_1:='0';
s_source_2:='0';
s_result:='0';
result:=0;
point_flag:=false;
operation_symbol:=0;
input_2:=false;
display_refresh();
end;
procedure TForm1.Button15Click(Sender: TObject);
begin
operation_over:=true;
source_1:=strtofloat(s_source_1);
if input_2 then
begin
source_2:=strtofloat(s_source_2);
end
else
begin
// source_2:=source_1;
// s_source_2:=floattostr(source_2);
end;
case operation_symbol of
0:
begin
result:=source_1;
display_refresh();
exit;
end;
1:
begin
result:=source_1+source_2;
display_refresh();
end;
2:
begin
result:=source_1-source_2;
display_refresh();
end;
3:
begin
result:=source_1 * source_2;
display_refresh();
end;
4:
begin
if source_2 = 0 then
begin
messagebox(form1.Handle,'0 不能做除数','错误!',0);
exit;
end;
result:=source_1 / source_2;
display_refresh();
end;
end;
input_2:=false;
source_1:=result;
s_source_1:=floattostr(result);
s_source_2:='0';
point_flag:=false;
end;
procedure TForm1.Button19Click(Sender: TObject);
begin
if result>=0 then
begin
operation_over:=true;
result:=sqrt(result);
display_refresh();
if input_2=true then
begin
source_2:=result;
s_source_2:='0';
input_2:=false;
end
else
begin
s_source_1:=floattostr(result);
end;
end
else
begin
messagebox(form1.Handle,'负数不能开根号','错误!',0);
end;
end;
procedure TForm1.Button30Click(Sender: TObject);
begin
if (operation_symbol >0) and (input_2 = true) then
begin
button15.Click;
end;
operation_symbol:=1;
// source_2:=0;
// s_source_2:='0';
point_flag:=false;
operation_over:=false;
end;
procedure TForm1.Button14Click(Sender: TObject);
begin
if (operation_symbol >0) and (input_2 = true) then
begin
button15.Click;
end;
operation_symbol:=2;
// source_2:=0;
// s_source_2:=floattostr(source_2);
point_flag:=false;
operation_over:=false;
end;
procedure TForm1.Button13Click(Sender: TObject);
begin
if (operation_symbol >0) and (input_2 = true) then
begin
button15.Click;
end;
operation_symbol:=3;
// source_2:=0;
// s_source_2:=floattostr(source_2);
point_flag:=false;
operation_over:=false;
end;
procedure TForm1.Button12Click(Sender: TObject);
begin
if (operation_symbol >0) and (input_2 = true) then
begin
button15.Click;
end;
operation_symbol:=4;
// source_2:=0;
// s_source_2:=floattostr(source_2);
point_flag:=false;
operation_over:=false;
end;
procedure TForm1.Button24Click(Sender: TObject);
begin
if result <> 0 then
begin
operation_over:=true;
result:=1 / result;
display_refresh();
if input_2=true then
begin
source_2:=result;
s_source_2:='0';
input_2:=false;
end
else
begin
s_source_1:=floattostr(result);
end;
end
else
begin
messagebox(form1.Handle,'0 不能求倒数','错误!',0);
end;
end;
procedure TForm1.Button28Click(Sender: TObject);
begin
if input_2 = true then
begin
s_source_2:='0';
source_2:=0;
result:=0;
display_refresh();
end
else
begin
s_source_1:='0';
source_1:=0;
result:=0;
display_refresh();
end;
end;
procedure TForm1.Button10Click(Sender: TObject);
begin
result:=(-1)*result;
if input_2 then
begin
source_2:=result;
s_source_2:=floattostr(source_2);
end
else
begin
s_source_1:=floattostr(result);
end;
display_refresh();
end;
procedure TForm1.Button27Click(Sender: TObject);
begin
if input_2 = false then
begin
if length(s_source_1)>2 then
begin
delete(s_source_1,length(s_source_1),1);
result:=strtofloat(s_source_1);
display_refresh();
exit;
end;
if length(s_source_1)<=3 then
begin
result:=strtofloat(s_source_1);
if result <= 0 then
begin
s_source_1:='0';
end;
if result>0 then
begin
delete(s_source_1,length(s_source_1),1);
result:=strtofloat(s_source_1);
end;
display_refresh();
end;
end
else
begin
end;
end;
end.
实在不行再问我要完整的,我的邮箱345053709@qq.com
procedure TForm1.FormCreate(Sender: TObject);
begin
button0.Click;
end;
procedure TForm1.Button11Click(Sender: TObject);
begin
if point_flag=false then
begin
input_number(10);
point_flag:=true;
end;
end;
procedure TForm1.Button29Click(Sender: TObject);
begin
s_source_1:='0';
s_source_2:='0';
s_result:='0';
result:=0;
point_flag:=false;
operation_symbol:=0;
input_2:=false;
display_refresh();
end;
procedure TForm1.Button15Click(Sender: TObject);
begin
operation_over:=true;
source_1:=strtofloat(s_source_1);
if input_2 then
begin
source_2:=strtofloat(s_source_2);
end
else
begin
// source_2:=source_1;
// s_source_2:=floattostr(source_2);
end;
case operation_symbol of
0:
begin
result:=source_1;
display_refresh();
exit;
end;
1:
begin
result:=source_1+source_2;
display_refresh();
end;
2:
begin
result:=source_1-source_2;
display_refresh();
end;
3:
begin
result:=source_1 * source_2;
display_refresh();
end;
4:
begin
if source_2 = 0 then
begin
messagebox(form1.Handle,'0 不能做除数','错误!',0);
exit;
end;
result:=source_1 / source_2;
display_refresh();
end;
end;
input_2:=false;
source_1:=result;
s_source_1:=floattostr(result);
s_source_2:='0';
point_flag:=false;
end;
procedure TForm1.Button19Click(Sender: TObject);
begin
if result>=0 then
begin
operation_over:=true;
result:=sqrt(result);
display_refresh();
if input_2=true then
begin
source_2:=result;
s_source_2:='0';
input_2:=false;
end
else
begin
s_source_1:=floattostr(result);
end;
end
else
begin
messagebox(form1.Handle,'负数不能开根号','错误!',0);
end;
end;
procedure TForm1.Button30Click(Sender: TObject);
begin
if (operation_symbol >0) and (input_2 = true) then
begin
button15.Click;
end;
operation_symbol:=1;
// source_2:=0;
// s_source_2:='0';
point_flag:=false;
operation_over:=false;
end;
procedure TForm1.Button14Click(Sender: TObject);
begin
if (operation_symbol >0) and (input_2 = true) then
begin
button15.Click;
end;
operation_symbol:=2;
// source_2:=0;
// s_source_2:=floattostr(source_2);
point_flag:=false;
operation_over:=false;
end;
procedure TForm1.Button13Click(Sender: TObject);
begin
if (operation_symbol >0) and (input_2 = true) then
begin
button15.Click;
end;
operation_symbol:=3;
// source_2:=0;
// s_source_2:=floattostr(source_2);
point_flag:=false;
operation_over:=false;
end;
procedure TForm1.Button12Click(Sender: TObject);
begin
if (operation_symbol >0) and (input_2 = true) then
begin
button15.Click;
end;
operation_symbol:=4;
// source_2:=0;
// s_source_2:=floattostr(source_2);
point_flag:=false;
operation_over:=false;
end;
procedure TForm1.Button24Click(Sender: TObject);
begin
if result <> 0 then
begin
operation_over:=true;
result:=1 / result;
display_refresh();
if input_2=true then
begin
source_2:=result;
s_source_2:='0';
input_2:=false;
end
else
begin
s_source_1:=floattostr(result);
end;
end
else
begin
messagebox(form1.Handle,'0 不能求倒数','错误!',0);
end;
end;
procedure TForm1.Button28Click(Sender: TObject);
begin
if input_2 = true then
begin
s_source_2:='0';
source_2:=0;
result:=0;
display_refresh();
end
else
begin
s_source_1:='0';
source_1:=0;
result:=0;
display_refresh();
end;
end;
procedure TForm1.Button10Click(Sender: TObject);
begin
result:=(-1)*result;
if input_2 then
begin
source_2:=result;
s_source_2:=floattostr(source_2);
end
else
begin
s_source_1:=floattostr(result);
end;
display_refresh();
end;
procedure TForm1.Button27Click(Sender: TObject);
begin
if input_2 = false then
begin
if length(s_source_1)>2 then
begin
delete(s_source_1,length(s_source_1),1);
result:=strtofloat(s_source_1);
display_refresh();
exit;
end;
if length(s_source_1)<=3 then
begin
result:=strtofloat(s_source_1);
if result <= 0 then
begin
s_source_1:='0';
end;
if result>0 then
begin
delete(s_source_1,length(s_source_1),1);
result:=strtofloat(s_source_1);
end;
display_refresh();
end;
end
else
begin
end;
end;
end.
实在不行再问我要完整的,我的邮箱345053709@qq.com
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
是什么数据库啊?ACCESS数据库使用TADOConnection组件,就可以连接
来自:求助得到的回答
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
http://zhidao.baidu.com/question/28358556.html
这是很多年前我还在用Delphi时的留言,简单的连接数据库的测试方法
这是很多年前我还在用Delphi时的留言,简单的连接数据库的测试方法
参考资料: sername
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
吧
这说不清
这说不清
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询