Drag and drop images in C++ Builder 6

只愿长相守 提交于 2019-12-06 15:31:00

I've sold my problem.

I did this in OnMouseDown event:

difference_x=Form1->Image1->Left-Mouse->CursorPos.x;
difference_y=Form1->Image1->Top-Mouse->CursorPos.y;
Timer1->Enabled=true;

and this on Timer:

int xxx=Mouse->CursorPos.x +difference_x ;
int yyy=Mouse->CursorPos.y +difference_y;

Image1->Top=yyy;
Image1->Left=xxx;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!