-
I've got a problem with the menu.
I created some code that drawes a line if I move the mouse over a picturebox, with the left button pressed. (the start coordinate is stored on mousedown, the second coordinate is the actual mouse position).
If I start this outside the picturebox (i.e. moving the mouse from outside the picturebox into the box with the buttom pressed) nothing is printed, that's OK. But if I start the same in the menu (off any menu item) the line is printed, starting at an old startposition( that's understandable, 'cause the last picture_mousedown is still valid), but why is the line printed now out all?
-
Do you have any code in your Form's MouseDown event that can possibly influence this? For example, there could be code to Reset the coordintes in the Form, but when you click in a Menu, there is no such code, so VB thinks that the coordinates are still the same as the old ones.
-
Nope, their is nothing.
The problem is not the "false" starting point (i.e. the last point where the mousedown event occured on the picture), I don't want to see this line if I start the action outside the picture.
-
I did some more testing.
On my Picturebox, I have several actions defined on MouseMove.
They are all showing the same behaviour:
If I start a mousemovement with the button pressed on a spot outside the picturebox, but on the form, the actions are NOT done ( even those actions, that do not require the button down!)
If I start the the mousemovement with button pressed on a spot of the menu, the actions are done!
What's the difference between this menu-area and the rest of the form??????
-
In not entirely sure of this but, the Menu area does not trigger any events related to the Form itself, hence, when your mouse is pressed, the Form will not trigger the event.
-
I start to think, that the part where I'm moving the mouse from the form into the picturebox( with button pressed) is strange. Because I do MOVE the Mouse on the Picture, but nothing happens as long as the button ias pressed. Neither the actions that require the button nor those that don't require it are done.
Still searching