Sunday, July 12, 2009

How to add Mouse drag event in C#??? please help !!!?

as we know,there are a number of predefined events in C# like mouse enter,mouse click etc etc...there are some events which are supported by C# but are not shown by default,for example the event "mouse drag" is present in C# but its not given directly in the GUI....


can some one please tell me how to add the mouse drag event in C#...

How to add Mouse drag event in C#??? please help !!!?
Perhaps you are looking for the DoDragDrop method?





As in , this.DoDragDrop ......





It is not an "event" it is a method that you call, that is why it is not listed. I call it on the MouseDown event. You will have to fill in the parameters (a) what data you are dragging and (b) what type of drag you are doing (move, copy).





The control you desire to drop upon must have the property "AllowDrop" set to true.





When the user drops the data, the "event" DragDrop will fire.

survey monkey

No comments:

Post a Comment