kexx1.pas

来自「delphi+SQL编写的销售系统」· PAS 代码 · 共 45 行

PAS
45
字号
unit kexx1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, StdCtrls, Buttons, Grids, DBGrids, ExtCtrls;

type
  TForm39 = class(TForm)
    Panel1: TPanel;
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    procedure DBGrid1DblClick(Sender: TObject);
    procedure DBGrid1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form39: TForm39;

implementation
  uses Datamodal,khdhxt;
{$R *.dfm}

procedure TForm39.DBGrid1DblClick(Sender: TObject);
begin
  Form22.StringGrid1.Cells[5,Form22.StringGrid1.RowCount-1]:= Data.ADOQuery2.FieldByName('客户编号').AsString;
  Form22.StringGrid1.Cells[6,Form22.StringGrid1.RowCount-1]:= Data.ADOQuery2.FieldByName('客户全称').AsString;
  Self.Close;
end;

procedure TForm39.DBGrid1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key = Vk_Return then
    DBGrid1.OnDblClick(Sender);
end;

end.

⌨️ 快捷键说明

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