Solved

I Cant figure out drag and drop!

Posted on 1998-09-26
4
172 Views
Last Modified: 2010-04-06
Can anyone explain to me how to use drag and drop within a delphi program.
thanks in advance.
Mike Ross
0
Comment
Question by:mykyl
  • 3
4 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1340877
Tell me your e-mail address and I'll send you some code....
0
 
LVL 10

Accepted Solution

by:
viktornet earned 50 total points
ID: 1340878
Here is the code but anyway, if you need the project tell me your e-mail address and I'll send ya somethin'
-----------------
ListBox1, and ListBox2 are TListBox 'es
//Set listbox1.DragMode := dmAutomatic;

procedure TForm1.ListBox2DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
  Accept := Sender is TListBox;
end;

procedure TForm1.ListBox2DragDrop(Sender, Source: TObject; X, Y: Integer);
var
  str : string;
begin
  str := listbox1.items[listbox1.itemindex];
  if listbox2.items.indexof(str) < 0 then
    listbox2.items.add(str);
end;
-----------

Regards,
Viktor Ivanov
0
 

Author Comment

by:mykyl
ID: 1340879
My email address is
mike @viprocess.ndirect.co.uk
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340880
Does it work now???

//Viktor
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

810 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