Solved

Dragging and dropping objects

Posted on 2003-10-28
2
184 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 125 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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 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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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