ВУЗ:
Составители:
Рубрика:
174
procedure TCalcForm.BtnMinusClick(Sender: TObject);
begin
EditResult.Text:=
IntToStr(StrToInt(EditOperand1.Text)-
StrToInt(EditOperand2.Text));
OperatorLabel.Caption:='-';
ResultLabel.Caption :='=';
EditOperand1.SetFocus;
end;
procedure TCalcForm.BtnDivideClick(Sender: TObject);
begin
EditResult.Text:=
FloatToStr(StrToFloat(EditOperand1.Text)/
StrToFloat(EditOperand2.Text));
OperatorLabel.Caption:='/';
ResultLabel.Caption :='=';
EditOperand1.SetFocus;
end;
procedure TCalcForm.BtnClearClick(Sender: TObject);
begin
EditOperand1.Text :='' ;
EditOperand2.Text :='' ;
EditResult.Text :='' ;
OperatorLabel.Caption:='?';
ResultLabel.Caption :='?';
EditOperand1.SetFocus;
end;
procedure TCalcForm.BtnCloseClick(Sender: TObject);
begin
Close;
end;
procedure TCalcForm.BtnMinusClick(Sender: TObject); begin EditResult.Text:= IntToStr(StrToInt(EditOperand1.Text)- StrToInt(EditOperand2.Text)); OperatorLabel.Caption:='-'; ResultLabel.Caption :='='; EditOperand1.SetFocus; end; procedure TCalcForm.BtnDivideClick(Sender: TObject); begin EditResult.Text:= FloatToStr(StrToFloat(EditOperand1.Text)/ StrToFloat(EditOperand2.Text)); OperatorLabel.Caption:='/'; ResultLabel.Caption :='='; EditOperand1.SetFocus; end; procedure TCalcForm.BtnClearClick(Sender: TObject); begin EditOperand1.Text :='' ; EditOperand2.Text :='' ; EditResult.Text :='' ; OperatorLabel.Caption:='?'; ResultLabel.Caption :='?'; EditOperand1.SetFocus; end; procedure TCalcForm.BtnCloseClick(Sender: TObject); begin Close; end; 174