I want to pass the name of the component to a function or procedure that will eventually run a popup menu related to that component, having trouble sending the name of the control and I get an error.
I suppose that I should convert the TObject name to a string somehow.
unit1.pas(130,22) Error: Incompatible type for arg no. 1: Got "AnsiString", expected "TObject"
// this is just a little procedure to see the name passes, just for testing I want the name to go to the caption of form1
procedure TForm1.SliderRightClick(sender: TObject);
begin
Form1.caption := '';
end;
// this is the right click popup event of the control.
procedure TForm1.ECSlider1ContextPopup(Sender: TObject; MousePos: TPoint;
var Handled: Boolean);
Var this:string;
begin
this:=TComponent(sender).name;
// This does contain the control name ECSlider1
SliderRightClick(this);
// How can I send the name stored in the variable this to the procedure TForm1.SliderRightClick
end;