Delphi .NET (2) Database (71) Delphi IDE (90) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280)
Exchange Links About this site Links to us 
|
How to add DblClick event?
This article has not been rated yet. After reading, feel free to leave comments and rate it.
If it has TControl as an ancestor then put:
published property OnDblClick;
into your class declaration.
Otherwise use the following code to capture the message:
 | |  | |
type
TYourClass=class(WhatEverclass you want)
private
FOnDblClick : TNotifyEvent;
procedure WMDblClick(var :TWMLButtonDBLCLK);
message WM_LBUTTONDBLCLK;
public
OnDblClick : TNotifyEvent read FOnDblClick write FOnDblClick;
end;
procedure TYourClass.WMDblClick(var :TWMLButtonDBLCLK);
begin
inherited;
end;
procedure TYourClass.WMDblClick(var :TWMLButtonDBLCLK);
begin
inherited;
if Assigned (FOnDblClick)
FOnDblClick(Self);
end; | |  | |  |
Comments:
|