"Dan" <da*@nospam.com > wrote:
You can control the data that is passed in a drag
operation. If you want to know the source control,
pass a reference to that control as the data.
Hi. How do I do this? The only place that my DragDrop
function is referenced in code is:
"this.listviewM onday.DragDrop += new [...]
Add a handler to the source control that calls DoDragDrop. Suppose
you're dragging from a ListView control; you might do something like
this:
private void myListView_Mous eDown(object sender,
System.Windows. Forms.MouseEven tArgs e)
{
myListView.DoDr agDrop(myListVi ew, DragDropEffects .Copy |
DragDropEffects .Move);
}
The first parameter passed to DoDragDrop is the data to be passed to
the target control. In this case, we're passing a reference to
myListView, so that the target control can determine where we dragged
from. You can pass whatever information you want, though.
P.