• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

About Drag&Drop

How can I make program with Drag&Drop process? For example: I want to make program whish will get filename and path of file which I drag forom Windows Explorer or my desktop?
Can you send me source code?
0
milmil
Asked:
milmil
1 Solution
 
rwilson032697Commented:
Look in the delphi section of this page:

http://www.melander.dk/

It has a very good drag and drop component thats free with source code.

Cheers,

Raymond.
0
 
martin_gCommented:
Hi,
Here's some code that worked for me copying files from a File List Box to a ChekList Box:

procedure TDSBMainForm.CheckListBox1DragDrop(Sender, Source: TObject; X,
  Y: Integer);
 begin
  AddFilesToList;
 end;


procedure TDSBMainForm.FileListBox1EndDrag(Sender, Target: TObject; X,
  Y: Integer);
begin
if Target <> nil then FileListBox1.Update;

end;

procedure TDSBMainForm.AddFilesToList;
var
 i,j:integer;
 OkayToAdd:Boolean;

begin
  For i:= 0 to FileListBox1.Items.Count -1 do
   if FileListBox1.Selected[i] then
   {check to see if the new item is already in the checklist box}
   begin
      OkayToAdd:=False;
      for j:=0 to CheckListBox1.Items.Count -1 do
        if ExpandFileName(FileListBox1.Items[i])=CheckListBox1.Items[j] then OkayToAdd:=true;
      if OkayToAdd<>true then
        CheckListBox1.Items.Add(ExpandFileName(FileListBox1.items[i]));
   end {if}
end;
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now