5,379
社区成员
发帖
与我相关
我的任务
分享
type
TStringGrid=class(Grids.TStringGrid)
procedure WMCommand(var Message: TWMCommand); message WM_COMMAND;
end;
TForm1 = class(TForm)
sg: TStringGrid;//是我们重新定义过的TStringGrid
...
procedure TStringGrid.WMCommand(var Message: TWMCommand);
begin
inherited;//保留TCustomGrid的处理代码
with Message, TMessage(Message) do//将消息传给子控件
Message.Result := SendMessage(Ctl, Msg + CN_BASE, WParam, LParam);
end;