Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drag & Drop / C++ Builder.

Status
Not open for further replies.

zikar

Programmer
Oct 10, 2000
31
JP
Hi,

After trying several things, I haven't been able to implement a drag & drop feature in a dialog baseed application, built with C++ Builder. If someone knows how to do this, please give me a tip (or/and a piece of code).

I had no problem when I tried something similar with MFC, but for some reason I can't get it OK with builder.

Thanks

 
It really shouldn't too hard to impliment. In your OnMouseDown event you need to place a BeginDrag function. You will also need to have a OnDragDrop function and maybe OnDragOver, and Accept or Reject.
James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
Hello James,

Thanks for your suggestion.

I tried quite a few things, playing around with :
FormDragDrop, FormDragOver, FormMouseDown, FormMouseUp;
filling those functions with code like :
{
ShowMessage("FormMouseUp called.");
}
in order to understand when they were called.

As a result I was able to check when FormMouseDown and FormMouseUp were called;
but FormDragDrop and FormDragOver were appearently never called. I don't really understand why.

But I don't get any thing by putting BeginDrag inside FormMouseDown (matching the OnMouseDown event), except crashing my program.

Well, there is certainly something I don't do right, but I don't know what.
Things would probably look much simpler and easier if I knew how to do it.
So if you happen to find a very basic C++ Builder sample program doing a drag and drop, please let me know.

Bye and thanks.

Michel

Note : Just in case you are interested, I made a simple software as a way for me to learn C++Builder, and I would like to implement a drag and drop feature in it. It is published as a freeware at :
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top