Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 5th, 2005, 8:43 PM   #1
cybatech
Newbie
 
Join Date: Jul 2005
Posts: 2
Rep Power: 0 cybatech is on a distinguished road
Unhappy DragMove a better explanation of what I need

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
cybatech is offline   Reply With Quote
Old Jul 6th, 2005, 10:29 AM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
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.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:18 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC