views:

555

answers:

2

Hi!

I'm developing an app for windows mobile. I have my own control that moves the picture inside it. I have overrided the OnMouseDown and OnMouseMove to redraw the picture where the user move it.

I only test it on Windows Mobile 6.1 Professional emulator. It works but I have a problem:

I click on the image, move it with the mouse, stop moving holding down the left button of the mouse, wait a seconds and the release the button without moving the mouse and the picture moves again. What it's happenning?

I think that the event OnMouseMove is fired with the event OnMouseUp but I'm not sure.

Thank you!

A: 

I have never tryed some thing on windows mobile, but if your unsure of the events then make a multi line textbox and add some text to it each time a even is fired that way you should know when its fired..

Petoj
A: 

The Mouse messages are quite consistent, you may get an unnecessary looking Move every now and then but that is to the same coordinates.

So why does your picture move? Impossible to answer without a little more information.

A guess: You are mixing EventArgs.X/Y with MousePosition.X/Y . The latter are in screen coordinates.

Henk Holterman
I solve this problem checking the coordinates: if they are the same I do nothing.
VansFannel