?
Solved

Dragging and dropping objects

Posted on 2003-10-28
2
Medium Priority
?
188 Views
Last Modified: 2010-04-05
Hello!

I'm quite new to Delphi and I know how things should work in theory because I have been programming with other languages for years. I'm trying to make a simple image browser with one form.

On Form1 I have two Scrollboxes. In the first Scrollbox I would like to put the objects (thumbnail images which are created on run-time).

And then I have a second Scrollbox. The thumbnails which I have in Scrollbox1 are based on the code found at http://www.b-zone.de/zips/thmbnail.zip

The biggest problem I have is that I don't know how to drag a object from Scrollbox1 to Scrollbox2.
0
Comment
Question by:mazze
[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 3

Accepted Solution

by:
huferry earned 250 total points
ID: 9632848
The theory is:

The source component:
- Set the property DragMode to dmAutomatic
- Use the event OnStartDrag
- Pass your parameter as an TDragObject instance

The target component:
- Use the event OnDragOver, based on the Sender and
  the Source you can decide either to accept or reject it.
- Sender = source component; Source = Drag object
- Use the event OnDragDrop to handle the object dropping.
  Again, you'll get the Sender and the Source
- TDragObject will be automatically destroyed.

happy trying!

regards,
huferry
0
 

Author Comment

by:mazze
ID: 9640111
Thanks! I finally solved the problem even if it took several hours for me to do it.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

649 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