![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2005
Posts: 2
Rep Power: 0
![]() |
I have a Form with a button that creates a shape (Tshape) at runtime.
I would then like to be able to MOVE the shape around the form with the mouse. I don’t need to resize the shape just move it. Some code would be greatly appreciated. Thanks |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Try to stick to one thread when you have a single problem. This could have easily been posted in your other thread.
Moving onto the problem: check out the TShape's OnMouseDown and OnMouseUp events. The first one fires when the mouse is pressed down onto the shape - I bet you can guess when the second fires. What I suggest doing is setting a global boolean variable to True when the mouse is pressed down, and resetting it to False when the mouse is let go. You can then find the coordinates of the mouse pointer in the actual form's OnMouseMove event, and move it as you see fit. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|