Solved

I Cant figure out drag and drop!

Posted on 1998-09-26
4
171 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

939 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now