Solved

About Drag&Drop

Posted on 1999-01-10
2
148 Views
Last Modified: 2010-04-06
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
Comment
Question by:milmil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 50 total points
ID: 1355800
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
 
LVL 1

Expert Comment

by:martin_g
ID: 1355801
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question