"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.listviewMonday.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_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
myListView.DoDragDrop(myListView, 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.