Drag and Drop из RichEdit

Previous  Top  Next

    
 

 

Code:

var

  Form1: TForm1;

  richcopy: string;

  transfering: boolean;

implementation

 

{$R *.DFM\}

 

procedure TForm1.RichEdit1MouseDown(Sender: TObject; Button: TMouseButton;

  Shift: TShiftState; X, Y: Integer);

begin

if length(richedit1.seltext)>0 then begin

  richcopy:=richedit1.seltext;

  transfering:=true;

end; //seltext

end;

 

procedure TForm1.ListBox1MouseMove(Sender: TObject; Shift: TShiftState; X,

  Y: Integer);

begin

if transfering then begin

  transfering:=false;

  listbox1.items.add(richcopy);

end; //transfering

end;

 

©Drkb::00702

http://delphiworld.narod.ru/

DelphiWorld 6.0