cxgrid的onkeydown事件 请教一个简单的问题:怎么使cxGrid1DBTableView1的onkeydown事件触发cxGrid1DBTableView1的oncellclick事件? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 最简单的做法:建立一个Action,在两个事件中,写Action.Execute; 谢谢!!能否具体一点?刚查阅了一下action的用法,还是不太懂。 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxStyles, dxSkinsCore, dxSkinsDefaultPainters, dxSkinscxPCPainter, cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ActnList, cxGridLevel, cxClasses, cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid;type TForm1 = class(TForm) grdViewGrid1DBTableView1: TcxGridDBTableView; grdLvlGrid1Level1: TcxGridLevel; grd1: TcxGrid; actlst1: TActionList; act1: TAction; procedure act1Execute(Sender: TObject); procedure grdViewGrid1DBTableView1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); procedure grdViewGrid1DBTableView1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.act1Execute(Sender: TObject);begin ShowMessage('Action Execute!');end;procedure TForm1.grdViewGrid1DBTableView1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);begin act1.Execute;end;procedure TForm1.grdViewGrid1DBTableView1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin act1.Execute;end;end. 对你的景仰犹如滔滔江水,绵绵不绝。教我学会用action了。 关于快速输入的解决方案 关于两个form同时显示 挑战高难度,组件读写问题 为什么dxdbgrid导出到excel的速度比dbgirdeh快?什么grid控件导出到excel的速度最快? 请教关于数据库浮点数在DELPHI中的处理? 高难度逻辑分析题之二 关于定制TOOLBAR的问题,高手请进(500分相送) 我要疯了------〉〉〉〉〉〉〉〉为什么访问本类的私有变量都能造成非法访问内存? ★★★求兼职(成都)★★★ 现在学Delphi还有用吗? 有没有人做过现在税务局自开票软件的验旧程序 关于des加密那块能不能帮忙告诉一下怎么实现的 彻底解决TreeView控件状态图标问题
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
cxStyles, dxSkinsCore, dxSkinsDefaultPainters, dxSkinscxPCPainter,
cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ActnList,
cxGridLevel, cxClasses, cxGridCustomView, cxGridCustomTableView,
cxGridTableView, cxGridDBTableView, cxGrid;type
TForm1 = class(TForm)
grdViewGrid1DBTableView1: TcxGridDBTableView;
grdLvlGrid1Level1: TcxGridLevel;
grd1: TcxGrid;
actlst1: TActionList;
act1: TAction;
procedure act1Execute(Sender: TObject);
procedure grdViewGrid1DBTableView1CellClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift:
TShiftState; var AHandled: Boolean);
procedure grdViewGrid1DBTableView1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.act1Execute(Sender: TObject);
begin
ShowMessage('Action Execute!');
end;procedure TForm1.grdViewGrid1DBTableView1CellClick(Sender:
TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo;
AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
act1.Execute;
end;procedure TForm1.grdViewGrid1DBTableView1KeyDown(Sender: TObject; var Key:
Word; Shift: TShiftState);
begin
act1.Execute;
end;end.