Solved

Dragging and dropping objects

Posted on 2003-10-28
2
183 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to center only a line in richedit? 4 69
Multi-layered image in FireMonkey 9 68
Delphi: sending SMS on android platform 1 65
migrate this code to work on android 1 30
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…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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