I am writing a drag and drop system for the visualizer. When you click and drag, it moves what you see in the window. When the mouse lands on the edge of the panel, I begin to move the cursor so that it never leaves the field. It keeps track of the virtual position the cursor will be in if it is inside the box. This part of the code is working fine.
Anytime there is a MouseMoved event, and the position is inside the field, I do Cursor.Show (). If it's out of the box, I do Cursor.Hide (). When the user allows me to move from the mouse button, I do Cursor.Show ().
There are several issues. When the first Hidden Call occurs, it is not hidden. I have to get the virtual cursor position outside the containing window in order to hide it. When I go back, it becomes invisible, even though Show is called. Finally, when you release the mouse button, the cursor does not appear, even though Show is called.
Instead of asking people to debug my code, I'm just wondering what happens in the event system, which makes Cursor.Hide / Show not work as I expect. I got the impression that if the control is called Hide, the cursor will be hidden at any time when it is inside this control; Similarly, if I call a show from a control.
source
share