put stuff to a new component
Posted on 1997-03-18
There are some buttons and a shape in a form with the code:
procudure Tform1.comehere(AControl: TControl);
form1.shape1.left := AControl.left + AControl.width;
form1.shape1.top := AControl.top;
All buttons got OnClick event:
procedure Tform1.Button1Click(sender: TObject);
In runtime, when I click and button, the shape will go to the button...works fine.
My question is: How to put procedure Tform1.comehere and the shape into a new component
Tmoveshape = class(TCustomControl)
so that in designtime, I just need to put Tmoveshape to the form the shape will be automatically created and the work will be done (put method moveshape.comehere(Button1) in the event OnClick in each button).
PS. I have tried to make my question clear, but slill not very good :-(