By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,643 Members | 1,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,643 IT Pros & Developers. It's quick & easy.

differ mouse down from mouse click

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
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

"Boni" <oilia@nospam> wrote in message
news:OC**************@TK2MSFTNGP15.phx.gbl...
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

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.