DragDrop event:
(Source as TLabel).left;
(Source as TLabel).top;

DragOver event:
Accept := (Source as TLabel);

Dave

--- On Mon, 5/24/10, Niel <ralphs...@att.net> wrote:

From: Niel <ralphs...@att.net>
Subject: [advanced_delphi] Drag Drop Labels
To: advanced_delphi@yahoogroups.com
Date: Monday, May 24, 2010, 12:36 AM







 



  


    
      
      
      I have some labels that I want to reposition on a chart with Drag Drop.

I chose dmAutomatic for the labels. 



As shown below, the code won't compile.  

Delphi says that Left and Top are Undeclared for source.  

When I replace source with a specific label name the program 

runs and the specific label will reposition correctly. 



What should I replace source with in the code below to make 

the program work in a generalized way?



procedure TForm1.Chart1DragDrop(Sender, Source: TObject; X, Y: Integer);

begin

  source.left := x;

  source.top := y;

end;



procedure TForm1.Chart1DragOver(Sender, Source: TObject; X, Y: Integer;

  State: TDragState; var Accept: Boolean);

begin

  accept := true;

end;





    
     

    
    


 



  






      

Reply via email to