Just call it directly, using either nil
or another component as the Sender
:
procedure TForm1.CheckListBox2DblClick(Sender: TObject);
begin
Button1Click(nil);
end;
procedure TForm1.CheckListBox2DblClick(Sender: TObject);
begin
Button1Click(CheckListBox2);
end;
Note you don't use the classname (or variable name) of the form itself, since you're calling from the current instance of the form. IOW, do not use TForm1
or Form1
inside of a class method; that limits you to a specific instance of the form instead of being available to all instances. If you need to qualify it, use Self
, as in Self.Button1Click(nil);
.