📄 mcountunit.pas
字号:
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)or(GoodName.Text='')or(Amount.Value<=0) 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -