khxx3.pas

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

PAS
50
字号
unit khxx3;

interface

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

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

var
  Form40: TForm40;

implementation
  uses DataModal,xsglxt;
{$R *.dfm}

procedure TForm40.DBGrid1DblClick(Sender: TObject);
begin
  with Form24 do
  begin
    StringGrid1.Cells[6,StringGrid1.RowCount-1]:= Data.ADOQuery2.FieldByName('客户全称').Value;
    StringGrid1.Cells[5,StringGrid1.RowCount-1]:= Data.ADOQuery2.FieldByName('客户编号').Value;
  end;
  Close;
end;

procedure TForm40.DBGrid1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Data.ADOQuery2.Active = True then
  begin
   if key = Vk_ReTurn then
      DBGrid1.OnDblClick(Sender);
  end;
end;

end.

⌨️ 快捷键说明

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