C#: Drag & Drop with right mouse button - c#

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.

Related

In C#, won't drag enter, drag drop and drag leave get triggered when a control is dragged and dropped over other?

In C#, when I drop a file on panel, drag events are triggered automatically. But if I drag a control like Button on another control like Button, no drag event gets triggered. Do we need to use mouse down and mouse down for this?

C# light-up button on mouse hover

You know when you add a button in winForms, and then debug, on mouse over the button light`s up. I guess that a hover effect. I want to do the same thing to a pictureBox. How can i do it?
One thing i want this is becouse i added a picture box and imported a .png image of a button. And i am trying to make my own personalized buttons. Is there any smarter/other way to make a button?
You can hook into the MouseHover event on the Control object to do this.
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.mousehover.aspx

Create another mouse cursor

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

Mouse middle button click functionality in Infragistics Ultragrid

In Excel, middle mouse button click work as a toggle. That is, if you press it once, it will allow you to scroll in your chosen direction till the time you click it again.
However, in Infragistics Ultragrid, this scrolling functionality is available only while middle mouse button remains pressed. How can I make Infragistics Ultragrid middle mouse button click work as in excel?
Otherwise also, what is the way to do it in winforms?
It's not as complicated as you might think. Clicking either the mouse wheel or middle button (depending on the type of Mouse the user has) fires off a MouseWheel event which must be handled and processed like any other event.
You'll need to configure a small "scrolling state machine" for you application. By this, I mean that the user is either scrolling in, say, a NormalMode, where using scroll bars or flicking up/down on the mouse wheel produces the same effect (scrolling up/down). Or, the application is in a HoverScrollingMode which occurs whenever the user has clicked the middle button (or mouse wheel) and is moving the mouse north or south of the click point.
I can't give you a programming example without seeing how your application currently handles other types of mouse events, but your overall strategy is to handle these MouseWheel events, use them to switch your application state (into, say, HoverScrollingMode) and then programmatically move the viewport up/down depending on the current position of their mouse.
Hope this helps, and good luck!

During drag drop, how to show a popup with text(or a cursor with text) that follows the mouse cursor in WPF

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.

Categories