Solved

About Drag&Drop

Posted on 1999-01-10
2
147 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
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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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