moving a command button with mouse

J

Jeff

I want to have a command button on my form that when pressed it will drag to
the location where I let go of the mouse button. I have experimented with
mouseup...not working.
 
P

PC Datasheet

Jeff,

Use the Mouse Move event. In code, continually detect the position of the
Mouse (Mouse coordinates) and adjust the Top and Left properties of the
command button. Keep in mind you are working in Twips - 1440 Twips = 1".
 
J

Jeff

OK....I know this will work just by placing the mouse over the command
button but what if I need to click the button....hold it down...move the
button....release to new location.
 
M

Mike Painter

The directions given are exactly what you need. You must write the code to
do it.
Note that you probably want the button to jump to the new location.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top