Solved

I Cant figure out drag and drop!

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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 tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

20 Experts available now in Live!

Get 1:1 Help Now