5,388
社区成员
发帖
与我相关
我的任务
分享
property OnMouseDown: TMouseEvent read GetOnMouseDown write SetOnMouseDown;
procedure GetOnMouseDown;
begin
result := Label.OnMouseDown;
end;
procedure SetOnMouseDown(DownEvent: TMouseEvent);
begin
Label.OnMouseDown : DownEvent;
end;
TCustomDuoDBTreeList = class(TcxCustomDBTreeList)
private
FDropListControl: TControl;
FOldProc:TFarProc;
procedure SetDropListControl(const Value: TControl);
protected
procedure DropListProc(var Msg: TMessage);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property DropListControl:TControl read FDropListControl write SetDropListControl;
end;
procedure TCustomDuoDBTreeList.SetDropListControl(const Value: TControl);
var pp:TPoint;f:TCustomForm;//p:Pointer;
begin
FDropListControl := Value;
// FOldProc:=Pointer(FDropListControl.WindowProc);
// FDropListControl.WindowProc:=DropListProc;
// if FDropListControl is TWinControl then
// begin
// FOldProc:=Pointer(GetWindowLong((FDropListControl as TWinControl).Handle,GWL_WNDPROC));
// p:=MakeObjectInstance(DropListProc);
// SetWindowLong((FDropListControl as TWinControl).Handle,GWL_WNDPROC,LongInt(p));
// end;
end;
procedure TCustomDuoDBTreeList.DropListProc(var Msg: TMessage);
begin
case Msg.Msg of
WM_LBUTTONDOWN:ShowMessage('鼠标按下');
else
Msg.Result:=DefWindowProc((FDropListControl as TWinControl).Handle,Msg.Msg,Msg.WParam,Msg.LParam);// 其它消息做默认处理
end;
end;