⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 morepay.pas

📁 简单的餐饮软件部分源码
💻 PAS
字号:
unit morepay;

interface

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

type
  Tfmorepay = class(TForm)
    but1: TButton;
    procedure but1Click(Sender: TObject);
    procedure Paybutclick(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
    paycount:Integer;
  public
    { Public declarations }
  end;

var
  fmorepay: Tfmorepay;
  paybut:array[1..9] of TButton;
  payid:array[1..9] of TLabel;
implementation
uses SnackDM,payform;
{$R *.dfm}
procedure Tfmorepay.Paybutclick(Sender:TObject);
Var bi:Integer;
begin
 for bi:=1 to paycount do
  begin
   if sender=paybut[bi] then
    begin
//      fpay.Lcap4:=paybut[bi].Caption;
//   Application.CreateForm(Tfpay,fpay);
//      but1Click(Sender);
//      fpay:=Tfpay.Create(nil);
//      fpay.ShowModal;
    end;
  end;
end;
procedure Tfmorepay.but1Click(Sender: TObject);
begin
 self.Close;
 self.Release;
end;
procedure Tfmorepay.FormShow(Sender: TObject);
Var bu,buh,buw:Integer;
begin
 with datam.morepayado do
  begin
   Close;
   SQL.Clear;
   SQL.Add('select * from snmorepay');
   Open;
   paycount:=Recordcount;
  if paycount<=0 then Exit else
    begin
     First;
     buh:=16;
     buw:=1;
     for bu:=1 to paycount do
      begin
       paybut[bu]:=TButton.Create(nil);
       paybut[bu].Parent:=fmorepay;
       paybut[bu].Height:=64;
       paybut[bu].Width:=120;
       paybut[bu].Caption:=Trim(FieldValues['payname']);
       paybut[bu].Left:=122*(buw-1)+16;
       paybut[bu].Top:=buh;
       paybut[bu].OnClick:=Paybutclick;
       if buw=3 then
        begin
         buw:=1;
         buh:=buh+66;
        end else begin
                  buw:=buw+1;
                 end;
       payid[bu]:=TLabel.Create(nil);
       payid[bu].Parent:=paybut[bu];
       payid[bu].Caption:=Trim(FieldValues['payid']);
       payid[bu].Visible:=False;
  Next;
      end;
    end;
  end;
  paybut[1].Default:=True;
end;
end.

⌨️ 快捷键说明

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