I have following Procedure in
Form1 :
procedure btn1Click;
begin
showMessage('1');
end;
The button btn1 will be created in other module -
unit2,
I need assign event OnClick to btn1 within
unit2, no within
Form1.
In
Form1 module is accessible variable
BtnClick, which is defined in
unit2:
Type
TBtnClick = Procedure;
Var BtnClick:TBtnClick;
I was trying to transmit event btn1Click thus:
In
Form1:
In
unit2:
btn1.OnClick := ^BtnClick;
Was error.
I was trying following variants too:
btn1.OnClick := BtnClick;
and
btn1.OnClick := @BtnClick;
Unsuccessfully.
Please, how to assign event OnClick in this case?