Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Drag & Drop

29 views
Skip to first unread message

Lars Lundstedt

unread,
Feb 3, 2001, 12:01:33 PM2/3/01
to
I've been trying to figure out how to user Drag & Drop in .NET but I can't
even figure out how to get started. What I want is to be able to drag items
between two ListViews and also within a ListView.

Any ideas?

/LasseLu


Lutz Roeder

unread,
Feb 3, 2001, 3:11:55 AM2/3/01
to
this shows how to drop filenames to a form.
dragging between windows should be not much more complicated.


AllowDrop = true;
DragEnter += new DragEventHandler(Me_DragEnter);
DragDrop += new DragEventHandler(Me_DragDrop);

protected void Me_DragEnter(Object s, DragEventArgs e)
{
e.Effect = DragDropEffects.All;
}

protected void Me_DragDrop(Object s, DragEventArgs e)
{
if (e.Data.GetDataPresent("FileDrop"))
{
foreach (String FileName in (String[]) e.Data.GetData("FileDrop"))
{
... process FileName ...
}
}
}


0 new messages