This is from a blank form, at runtime it creates a button having overridden the
DblClick method inherited from TControl.
TControl calls the DBlClick method when the control is double clicked. It isn't
reimplemented in its descendant TButtonControl or TButton.
By overriding the DblClick method in my descendant class this new method should
be called when a double click takes place on the TButton. However this doesn't
appear to be occurring. Any ideas? I missed something?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TMyButton = class(TButton)
public
procedure DblClick; override;
end;
var
Form1: TForm1;
MyButton : TMyButton;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
MyButton := TMyButton.Create(Self);
MyButton.Parent := Self;
end;
{ TMyButton }
procedure TMyButton.DblClick;
begin
Caption := 'İİİİİ';
inherited;
end;
end.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"