I want to create another mouse cursor that can move and click automatically in one window, and main mouse cursor can move in and out but can't change anything in this window.
Can C# do this? How can I do it?
Thanks
Related
I have created a custom control.
I have drawn a text inside the control.
In that, I'm trying to change the default cursor to Hand cursor when moving the mouse pointer on a particular region(Region where the text drawn inside the control).
For that, I have changed the cursor on the MouseMove event of the control.
if (textRect.Contains(e.Location))
{
Cursor.Current = Cursors.Hand;
}
I'm getting a flickering effect when moving the mouse over the control.
That is, the cursor is changed to hand cursor and back to default cursor.
I can't able to figure out why it is happening.
Provide your valuable suggestions to resolve this.
Thanks in advance.
I want to be able to drag around a 100% zoomed picture in a picturebox: http://spunit.tk/x/dragpic1.png.
I want it to work exactly like the Windows Photo Viewer: http://spunit.tk/x/dragpic2.png.
How is this possible?
I believe you need to maintain the coordinates of that picturebox, also set its view style to full-image, without any stretching.
Then, you will need three mouse events: mouse down, mouse up and mouse move, where you can get the mouse coordinates and capture or release mouse to translate the picture box according to mouse delta translation.
I need to show a popup to the user when he is dragging files or items onto my control. The popup basically informs him why dragging is disabled by giving him a message. I would like the popup to follow the mouse cursor whilst he is still in dragging mode.
OR is there a way to change the mouse cursor while dragging and displaying a text alongside the cursor?
If there are any other designs that you guys can suggest.. that would be nice too.
Thanks for your suggestions!
You might finde some suggestions on how to change the cursor here: Custom cursor in WPF?
One suggestion is to draw your popup on a canvas and move it as the cursor moves.
I'd like to do Drag & Drop with the right mouse button instead with the left one. However calling
DragDrop.DoDragDrop()
from MouseRightButtonDown instead of MouseLeftButtonDown doesn't do the job - DragDrop.DoDragDrop looks for mouse movements while holding down the left mouse button. Any idea how to realise Drag & Drop using the right mouse button? Thanks for any hint!
You need to make use of DragDrop.AddQueryContinueDragHandler(). Please see this post for details.
it is possible to change global mouse cursor from c#? the thing is i use a global hook shortcut key to capture a window like spywindow and i want to change mouse cursor globally when i select my handle and restore it when i click left mouse. Another question is about the click itself. When I'm in capture mode can i take click just for my purpose?it will be nice if i didn't press stuff on screen when i select my window!. Thanks!
Use
this.Cursor = Cursors.Cross; //to change the cursor to a cross, see Cursors for more options
when you select your handle, and when the left button is clicked use,
this.Cursor = Cursors.Default;
this should just be the relevant form/object that you want to change the cursor for.
For the cursor position, if you're using windows forms, just use System.Windows.Forms.Cursor.Position, as it is settable. The cursor class, not the cursor property of your form. To get global (screen) coords just use Form.PointToScreen(Point p). There's also PointToClient for the reverse.