mcountunit.~pas

来自「通过输入商品品名」· ~PAS 代码 · 共 45 行

~PAS
45
字号
unit MCountUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Spin, StdCtrls;

type
  TMCount = class(TForm)
    LabelName: TLabel;
    LabelPrice: TLabel;
    LabelAmount: TLabel;
    GoodName: TEdit;
    Count: TButton;
    Tariff: TMemo;
    Price: TSpinEdit;
    Amount: TSpinEdit;
    procedure CountClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MCount: TMCount;

implementation

{$R *.dfm}

procedure TMCount.CountClick(Sender: TObject);
begin
if(Price.Value<=0)and(Amount.Value<=0)and(GoodName.Text='') then
showmessage('输入有错误!')
else begin
tariff.Lines.Add('品名:'+GoodName.Text);
tariff.Lines.Add('单价:'+intToStr(Price.Value));
tariff.Lines.Add('数量:'+intToStr(Amount.Value));
tariff.Lines.Add('货款:'+intToStr(Price.Value*Amount.Value));
end;
end;
end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?