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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make a TImage to enable and disable dragging ..

Status
Not open for further replies.

Spent

Programmer
Mar 20, 2003
100
BG
How to make a TImage to enable and disable dragging by the mouse in run time? Thanks
 
You can't enable dragging of a TImage at run-time that I know of. You have to write the code yourself (which is basically an OnMouseDown/OnMouseMove functionality where you simply change the left and top values of the TImage when the mouse moves while a button is down.)

Chris
 
In Delphi there is a :
var x:Timage;
......
On mouseDown
x.BeginDrag(..);
...
On MouseUp
x.EndDrag;

IS this possible in Builder and how?
 
In C++ Builder, BeginDrag and EndDrag are methods used for drag and drop/dock operations only. As I explained above, the quickest way to draw the image is to use it's own OnMouseDown/OnMouseMove events to move it. You could get more complicated and draw it on a canvas that doesn't move, which would make it faster (if you needed), but I don't recommend that unless you just have to.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top