帮忙做一个delphi小程序。 60
帮忙做一个DELPHI小程序。不用涉及数据库的。比如计算器。计时器。就是只要做一个可以运行的小程序。还有设计报告就行了。...
帮忙做一个DELPHI小程序。不用涉及数据库的。比如计算器。计时器。
就是只要做一个可以运行的小程序。还有设计报告就行了。 展开
就是只要做一个可以运行的小程序。还有设计报告就行了。 展开
4个回答
展开全部
var
Form1: TForm1;
s1,s2,s3:real;
yunsuan,xiaoshudian,shuzi:integer;
m,n,k,fuhao,js:integer;
x,y:string;
ms:string;
xp,ll:string;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
pp:string;
m:integer;
begin
pp:=edit1.Text;
m:=length(pp);
if m=2 then
begin
edit1.Text:='0.';
xiaoshudian:=0;
end
else
begin
if pp[m]='.' then
begin
setlength(pp,m-2);
edit1.Text:=pp+'.'
end;
if pp[m]<>'.' then
begin
setlength(pp,m-1);
edit1.Text:=pp;
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text:='0.';
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='1.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'1'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'1';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='1.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='2.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'2'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'2';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='2.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='3.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'3'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'3';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='3.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='4.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'4'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'4';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='4.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button8Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='5.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'5'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'5';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='5.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button9Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='6.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'6'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'6';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='6.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button10Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='7.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'7'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'7';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='7.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button11Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='8.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'8'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'8';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='8.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button12Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='9.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'9'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'9';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='9.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button13Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='0.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'0'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'0';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='0.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button14Click(Sender: TObject);
begin
xiaoshudian:=1;
end;
procedure TForm1.Button15Click(Sender: TObject);
var
i,j:integer;
begin
if (n in [1,2,3,4]) then
begin
if shuzi=1 then
begin
s3:=strtofloat(edit1.Text);
s2:=s3;
case n of
1:x:=floattostr(s1+s2)+'.';
2:x:=floattostr(s1-s2)+'.';
3:x:=floattostr(s1*s2)+'.';
4:if s2=0 then
begin
x:='0.';
end
else
begin
x:=floattostr(s1/s2)+'.';
end;
end;
js:=1;
end;
if shuzi=0 then
begin
s2:=s3;
s1:=strtofloat(edit1.Text);
case n of
1:x:=floattostr(s1+s2)+'.';
2:x:=floattostr(s1-s2)+'.';
3:x:=floattostr(s1*s2)+'.';
4:if s2=0 then
begin
x:='0.';
end
else
begin
x:=floattostr(s1/s2)+'.'
end;
end;
js:=1;
end;
j:=0;
k:=length(x);
for i:=1 to k do
if x[i]='.' then
begin
j:=j+1;
end;
if j>1 then
begin
setlength(x,k-1);
edit1.Text:=x;
yunsuan:=1;
shuzi:=0;
end
else
begin
edit1.Text:=x;
yunsuan:=1;
shuzi:=0;
end;
end;
end;
procedure TForm1.Button16Click(Sender: TObject);
begin
s1:=strtofloat(edit1.Text);
n:=1;
yunsuan:=1;
if js=1 then
begin
js:=js+1;
end;
end;
procedure TForm1.Button17Click(Sender: TObject);
begin
s1:=strtofloat(edit1.Text);
n:=2;
yunsuan:=1;
if js=1 then
begin
js:=js+1;
end;
end;
procedure TForm1.Button18Click(Sender: TObject);
begin
s1:=strtofloat(edit1.Text);
n:=3;
yunsuan:=1;
if js=1 then
begin
js:=js+1;
end;
end;
procedure TForm1.Button19Click(Sender: TObject);
begin
s1:=strtofloat(edit1.Text);
n:=4;
yunsuan:=1;
if js=1 then
begin
js:=js+1;
end;
end;
procedure TForm1.Button21Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Button22Click(Sender: TObject);
var
xx:string;
yy:string;
j:integer;
begin
if fuhao=0 then
begin
xx:=edit1.Text;
edit1.Text:='-'+xx;
fuhao:=1;
end
else
if fuhao=1 then
begin
yy:=edit1.Text;
j:=pos('-',yy);
delete(yy,j,1);
edit1.Text:=yy;
fuhao:=0;
end;
end;
procedure TForm1.Button23Click(Sender: TObject);
var
x1,x2:real;
x3:string;
x4,x5,j:integer;
begin
x1:=strtofloat(edit1.Text);
x2:=(x1/100);
x3:=floattostr(x2);
x4:=length(x3);
j:=0;
for x5:=1 to x4 do
if x3[x5]='.' then
j:=j+1;
if j=1 then
begin
edit1.Text:=x3;
end;
if j<1 then
begin
edit1.Text:=x3+'.';
end;
yunsuan:=1;
js:=0;
n:=0;
end;
procedure TForm1.N3Click(Sender: TObject);
begin
close;
end;
procedure TForm1.N5Click(Sender: TObject);
begin
form2.Show;
end;
procedure TForm1.Button20Click(Sender: TObject);
begin
edit1.SelectAll;
edit1.CopyToClipboard;
showmessage('结果已复制到剪贴板');
end;
procedure TForm1.N2Click(Sender: TObject);
begin
edit1.SelectAll;
edit1.CopyToClipboard;
showmessage('结果已复制到剪贴板');
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
panel1.Caption:=datetostr(date)+' '+timetostr(time);
end;
procedure TForm1.Button24Click(Sender: TObject);
var
x1,x2:real;
x3:string;
x4,x5,j:integer;
begin
x1:=strtofloat(edit1.Text);
x2:=sqr(x1);
x3:=floattostr(x2);
x4:=length(x3);
j:=0;
for x5:=1 to x4 do
if x3[x5]='.' then
j:=j+1;
if j=1 then
begin
edit1.Text:=x3;
end;
if j<1 then
begin
edit1.Text:=x3+'.';
end;
yunsuan:=1;
js:=0;
n:=0;
end;
procedure TForm1.Button3Click(Sender: TObject);
var
x1,x2:real;
x3:string;
x4,x5,j:integer;
begin
x1:=strtofloat(edit1.Text);
if x1<0 then begin
edit1.Text:='0.';
end;
if x1>=0 then
begin
x2:=sqrt(x1);
x3:=floattostr(x2);
x4:=length(x3);
j:=0;
for x5:=1 to x4 do
if x3[x5]='.' then
j:=j+1;
if j=1 then
begin
edit1.Text:=x3;
end;
if j<1 then
begin
edit1.Text:=x3+'.';
end;
end;
yunsuan:=1;
js:=0;
n:=0;
end;
end.
Form1: TForm1;
s1,s2,s3:real;
yunsuan,xiaoshudian,shuzi:integer;
m,n,k,fuhao,js:integer;
x,y:string;
ms:string;
xp,ll:string;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
pp:string;
m:integer;
begin
pp:=edit1.Text;
m:=length(pp);
if m=2 then
begin
edit1.Text:='0.';
xiaoshudian:=0;
end
else
begin
if pp[m]='.' then
begin
setlength(pp,m-2);
edit1.Text:=pp+'.'
end;
if pp[m]<>'.' then
begin
setlength(pp,m-1);
edit1.Text:=pp;
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text:='0.';
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='1.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'1'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'1';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='1.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='2.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'2'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'2';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='2.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='3.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'3'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'3';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='3.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='4.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'4'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'4';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='4.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button8Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='5.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'5'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'5';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='5.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button9Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='6.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'6'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'6';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='6.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button10Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='7.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'7'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'7';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='7.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button11Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='8.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'8'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'8';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='8.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button12Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='9.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'9'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'9';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='9.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button13Click(Sender: TObject);
begin
if yunsuan=0 then
begin
if xiaoshudian=0 then
begin
if edit1.Text='0.' then
begin
edit1.Text:='0.';
end
else
if edit1.Text<>'0.' then
begin
y:=edit1.Text;
m:=length(y);
setlength(y,m-1);
edit1.Text:=y+'0'+'.';
end;
end;
if xiaoshudian=1 then
begin
y:=edit1.Text;
edit1.Text:=y+'0';
end;
end;
if yunsuan=1 then
begin
edit1.Text:='0.';
yunsuan:=0;
xiaoshudian:=0;
end;
shuzi:=1;
if js=1 then
begin
n:=0;
js:=js-1;
end;
end;
procedure TForm1.Button14Click(Sender: TObject);
begin
xiaoshudian:=1;
end;
procedure TForm1.Button15Click(Sender: TObject);
var
i,j:integer;
begin
if (n in [1,2,3,4]) then
begin
if shuzi=1 then
begin
s3:=strtofloat(edit1.Text);
s2:=s3;
case n of
1:x:=floattostr(s1+s2)+'.';
2:x:=floattostr(s1-s2)+'.';
3:x:=floattostr(s1*s2)+'.';
4:if s2=0 then
begin
x:='0.';
end
else
begin
x:=floattostr(s1/s2)+'.';
end;
end;
js:=1;
end;
if shuzi=0 then
begin
s2:=s3;
s1:=strtofloat(edit1.Text);
case n of
1:x:=floattostr(s1+s2)+'.';
2:x:=floattostr(s1-s2)+'.';
3:x:=floattostr(s1*s2)+'.';
4:if s2=0 then
begin
x:='0.';
end
else
begin
x:=floattostr(s1/s2)+'.'
end;
end;
js:=1;
end;
j:=0;
k:=length(x);
for i:=1 to k do
if x[i]='.' then
begin
j:=j+1;
end;
if j>1 then
begin
setlength(x,k-1);
edit1.Text:=x;
yunsuan:=1;
shuzi:=0;
end
else
begin
edit1.Text:=x;
yunsuan:=1;
shuzi:=0;
end;
end;
end;
procedure TForm1.Button16Click(Sender: TObject);
begin
s1:=strtofloat(edit1.Text);
n:=1;
yunsuan:=1;
if js=1 then
begin
js:=js+1;
end;
end;
procedure TForm1.Button17Click(Sender: TObject);
begin
s1:=strtofloat(edit1.Text);
n:=2;
yunsuan:=1;
if js=1 then
begin
js:=js+1;
end;
end;
procedure TForm1.Button18Click(Sender: TObject);
begin
s1:=strtofloat(edit1.Text);
n:=3;
yunsuan:=1;
if js=1 then
begin
js:=js+1;
end;
end;
procedure TForm1.Button19Click(Sender: TObject);
begin
s1:=strtofloat(edit1.Text);
n:=4;
yunsuan:=1;
if js=1 then
begin
js:=js+1;
end;
end;
procedure TForm1.Button21Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Button22Click(Sender: TObject);
var
xx:string;
yy:string;
j:integer;
begin
if fuhao=0 then
begin
xx:=edit1.Text;
edit1.Text:='-'+xx;
fuhao:=1;
end
else
if fuhao=1 then
begin
yy:=edit1.Text;
j:=pos('-',yy);
delete(yy,j,1);
edit1.Text:=yy;
fuhao:=0;
end;
end;
procedure TForm1.Button23Click(Sender: TObject);
var
x1,x2:real;
x3:string;
x4,x5,j:integer;
begin
x1:=strtofloat(edit1.Text);
x2:=(x1/100);
x3:=floattostr(x2);
x4:=length(x3);
j:=0;
for x5:=1 to x4 do
if x3[x5]='.' then
j:=j+1;
if j=1 then
begin
edit1.Text:=x3;
end;
if j<1 then
begin
edit1.Text:=x3+'.';
end;
yunsuan:=1;
js:=0;
n:=0;
end;
procedure TForm1.N3Click(Sender: TObject);
begin
close;
end;
procedure TForm1.N5Click(Sender: TObject);
begin
form2.Show;
end;
procedure TForm1.Button20Click(Sender: TObject);
begin
edit1.SelectAll;
edit1.CopyToClipboard;
showmessage('结果已复制到剪贴板');
end;
procedure TForm1.N2Click(Sender: TObject);
begin
edit1.SelectAll;
edit1.CopyToClipboard;
showmessage('结果已复制到剪贴板');
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
panel1.Caption:=datetostr(date)+' '+timetostr(time);
end;
procedure TForm1.Button24Click(Sender: TObject);
var
x1,x2:real;
x3:string;
x4,x5,j:integer;
begin
x1:=strtofloat(edit1.Text);
x2:=sqr(x1);
x3:=floattostr(x2);
x4:=length(x3);
j:=0;
for x5:=1 to x4 do
if x3[x5]='.' then
j:=j+1;
if j=1 then
begin
edit1.Text:=x3;
end;
if j<1 then
begin
edit1.Text:=x3+'.';
end;
yunsuan:=1;
js:=0;
n:=0;
end;
procedure TForm1.Button3Click(Sender: TObject);
var
x1,x2:real;
x3:string;
x4,x5,j:integer;
begin
x1:=strtofloat(edit1.Text);
if x1<0 then begin
edit1.Text:='0.';
end;
if x1>=0 then
begin
x2:=sqrt(x1);
x3:=floattostr(x2);
x4:=length(x3);
j:=0;
for x5:=1 to x4 do
if x3[x5]='.' then
j:=j+1;
if j=1 then
begin
edit1.Text:=x3;
end;
if j<1 then
begin
edit1.Text:=x3+'.';
end;
end;
yunsuan:=1;
js:=0;
n:=0;
end;
end.
展开全部
哈哈
那你创建一个form
放入一个button
双击button
输入:showmessage('hello word!');
就可以了.
那你创建一个form
放入一个button
双击button
输入:showmessage('hello word!');
就可以了.
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我觉得如果只是给你贴出来源代码是不太好的,毕竟里面包含了一些控件,所有你如果需要我可以将源程序传给你,那样你也方便看和理解
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
就一个计算器吗?放一个控件不就OK吗?你只说这些,又不说详细一点。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询