|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
unit Unit3;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm3 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Edit2: TEdit;
Edit3: TEdit;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
Button: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure ButtonClick(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
procedure Edit3Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
begin
Label1.Caption:= '+' ;
Edit3.Text:= FloattoStr(StrToFloat(Edit1.Text) + StrToFloat(Edit2.Text) );
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
Label1.Caption:= '-' ;
Edit3.Text:= FloattoStr(StrToFloat(Edit1.Text) - StrToFloat(Edit2.Text) );
end;
procedure TForm3.Button3Click(Sender: TObject);
begin
Label1.Caption:= '*' ;
Edit3.Text:= FloattoStr(StrToFloat(Edit1.Text) * StrToFloat(Edit2.Text) );
end;
procedure TForm3.Button4Click(Sender: TObject);
begin
Label1.Caption:= '/' ;
Edit3.Text:= FloattoStr(StrToFloat(Edit1.Text) / StrToFloat(Edit2.Text) );
end;
procedure TForm3.ButtonClick(Sender: TObject);
begin
Label1.Caption:= 'not' ;
Edit3.Text:= IntToStr( not StrToInt(Edit2.Text) );
Edit3.Text:= IntToStr( not StrToInt(Edit1.Text) );
end;
procedure TForm3.Edit1Change(Sender: TObject);
begin
edit1.Text:= ' '
end;
procedure TForm3.Edit2Change(Sender: TObject);
begin
edit2.Text:= ' '
end;
procedure TForm3.Edit3Change(Sender: TObject);
begin
edit3.Text:= ' '
end;
end.
最上面的button6-10全部报错了。刚刚对照着视频操作,莫名其妙。求大佬解释下。 |
|