|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
一边跟着小甲鱼老师学习一边做,就是不知道问题出在哪里。求指教
unit Unit1ww;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
edt_1: TEdit;
edt_2: TEdit;
edt_3: TEdit;
lbl_1: TLabel;
lbl_2: TLabel;
btn_1: TButton;
btn_2: TButton;
btn_3: TButton;
btn_4: TButton;
btn_5: TButton;
btn_6: TButton;
btn_7: TButton;
procedure edt_1Click(Sender: TObject);
procedure edt_2Click(Sender: TObject);
procedure edt_3Click(Sender: TObject);
procedure btn_1Click(Sender: TObject);
procedure btn_2Click(Sender: TObject);
procedure btn_3Click(Sender: TObject);
procedure btn_4Click(Sender: TObject);
procedure btn_5Click(Sender: TObject);
procedure btn_6Click(Sender: TObject);
procedure btn_7Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.edt_1Click(Sender: TObject);
begin
edt_1.Text:='';
end;
procedure TForm1.edt_2Click(Sender: TObject);
begin
edt_2.Text:='';
end;
procedure TForm1.edt_3Click(Sender: TObject);
begin
edt_3.Text:='';
end;
procedure TForm1.btn_1Click(Sender: TObject);
begin
lbl_1.Caption:='+';
edt_3.Text:=FloatToStr(StrToFloat(edt_1.Text)+strtofloat(edt_2.Text));
end;
procedure TForm1.btn_2Click(Sender: TObject);
begin
lbl_1.Caption:='-';
edt_3.Text:=FloatToStr(StrToFloat(edt_1.Text)-strtofloat(edt_2.Text));
end;
procedure TForm1.btn_3Click(Sender: TObject);
begin
lbl_1.Caption:='*';
edt_3.Text:=FloatToStr(StrToFloat(edt_1.Text)*strtofloat(edt_2.Text));
end;
procedure TForm1.btn_4Click(Sender: TObject);
begin
lbl_1.Caption:='/';
edt_3.Text:=FloatToStr(strtofloat(edt_1.Text)/strtofloat(edt_2.Text));
end;
procedure TForm1.btn_5Click(Sender: TObject);
begin
edt_3.Text:=IntToStr(StrToInt(edt_1.Text)and StrToInt(edt_2.Text));
end;
procedure TForm1.btn_6Click(Sender: TObject);
begin
edt_3.Text:=IntToStr(StrToInt(edt_1.Text)or StrToInt(edt_2.Text));
end;
procedure TForm1.btn_7Click(Sender: TObject);
begin
edt_1.Text:=IntToStr(Not StrToInt(edt_1.Text));
end;
end.
|
-
点击run无反应
|