Hello!
The question is if I try to add an own function to an event of a component, how can I find out the required parameters of that function?
For example, I have created a ScrollBar at runtime in my program, and I would like assign an own function to this OnScroll event:
myscrollbar:=TScrollBar.Create(self);
myscrollbar.parent:=self;
myscrollbar.kind:=sbVertical;
myscrollbar.left:=(Form1.width div 2)-4;
myscrollbar.top:=buttonAd.height+8;
myscrollbar.Height:=Form1.height-buttonAd.height-8;
myscrollbar.OnScroll:=@scrolling; //ERROR HERE because of missing paremeters!
The declaration of this function:
procedure scrolling(Sender: TObject; var ScrollPos: Integer);
And when I would use it:
procedure TForm1.scrolling(Sender: TObject; var ScrollPos: Integer);
begin
(...)
end;
But I got this error message because missing parameters above:
unit1.pas(211,40) Error: Incompatible types: got "<procedure variable type of procedure(TObject;var LongInt) of object;Register>" expected "<procedure variable type of procedure(TObject;TScrollCode;var LongInt) of object;Register>"