📄 inv_otherprice_hint.pas
字号:
unit Inv_OtherPrice_Hint;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Dialog, Db, AdODB, StdCtrls, Grids, DBGridEh;
Type
TFrm_Inv_OtherPrice_Hint = Class(TFrm_Base_Dialog)
DBGridEh1: TDBGridEh;
DataSource1: TDataSource;
procedure btn_okClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure DBGridEh1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure DBGridEh1DblClick(Sender: TObject);
procedure DBGridEh1GetCellParams(Sender: TObject; Column: TColumnEh;
AFont: TFont; var Background: TColor; State: TGridDrawState);
private
{ Private declarations }
public
procedure initform(ItemCode:string;AdoConnection:tAdoConnection);
{ Public declarations }
end;
var
Frm_Inv_OtherPrice_Hint: TFrm_Inv_OtherPrice_Hint;
implementation
{$R *.DFM}
procedure TFrm_Inv_OtherPrice_Hint.initform(ItemCode:string;AdoConnection:tAdoConnection);
begin
AdoQry_tmp.Connection:=AdoConnection;
AdoQry_tmp.Close;
AdoQry_tmp.sql.clear;
AdoQry_tmp.sql.text:=
' select o.VendorCode+'+''' '''+'+v.VendorName as VendorCodeName,o.Price,o.notaxPrice '+
' from OtherPrice o,Vendor v '+
' where o.ItemCode='''+ItemCode+''''+
' and o.VendorCode=v.VendorCode '+
' Order by o.VendorCode ';
AdoQry_tmp.open;
dataSource1.DataSet :=AdoQry_tmp;
end;
procedure TFrm_Inv_OtherPrice_Hint.btn_okClick(Sender: TObject);
begin
inherited;
modalResult:=mrok;
end;
procedure TFrm_Inv_OtherPrice_Hint.FormActivate(Sender: TObject);
begin
inherited;
dbgrideh1.setfocus;
end;
procedure TFrm_Inv_OtherPrice_Hint.DBGridEh1KeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
inherited;
if key=vk_return then btn_ok.Click;
end;
procedure TFrm_Inv_OtherPrice_Hint.DBGridEh1DblClick(Sender: TObject);
begin
inherited;
btn_ok.Click;
end;
procedure TFrm_Inv_OtherPrice_Hint.DBGridEh1GetCellParams(Sender: TObject;
Column: TColumnEh; AFont: TFont; var Background: TColor;
State: TGridDrawState);
begin
inherited;
if TDBGridEh(Sender).DataSource.DataSet.RecNo mod 2=1 then
Background:=$f0f0f0
else
Background:=clWindow;
if (gdSelected in State)or(gdFocused in State) then
begin
Background:=clNavy;
AFont.Color:=clWindow;
end
else
begin
AFont.Color:=clBlack;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -