我已查了继承链:
unit MEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, StdCtrls;
type
TMEdit = class(TEdit)
private
{ Private declarations }
procedure MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('YWF', [TMEdit]);
end;
{ TMEdit }
procedure TMEdit.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
Y: Integer);
begin
// MouseDown是接管OnMouseDown 的唯一过程,在TWinControl中定义
//inherited相当于后面的注释。
inherited; // if Assigned(FOnMouseDown) then FOnMouseDown(Self, Button, Shift, X, Y);
end;
end.