differ mouse down from mouse click

B

Boni

Dear all,
A mouse click on some object in my application should select this object,
where mouse down should start moving until mouse up.
But, when I press mouse down small move always happens. I tried to work with
move tolerance, but then if mouse was near the border of the object, it
leaves object and next mouse move is not passed to it. So I am thinking to
work with timer. I.e.
if MouseDown and NoMouseUpFor1second then move else ignore.
Is it a best solution or somebody has a better idea for this standard
problem?
With best regards,
Boni
 
P

Phil

Hi Boni,

This is a 'classic' issue with drag & drop. I can't remember the exact code
but hopefully this will help.

I believe you need to create an offset variable. The offset is made from the
difference between the TopLeft of your selected control and the current
mouse position wrt the screen. You then of course use this offset when
moving your control.

HTH,

Phil
 

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