On Thu, 15 Jun 2006 17:23:47 -0400, Rob <Ro*@nospam.com> wrote:
I've searched for info on how to drag and drop a group of strings (or
any other object) from one control to another. Looked through
articles by Dino Esposito, checked the Forms books by Sells and
MacDonald. You'd think it would be there.
Anyone know?
No takers? To qualify this, I *can* retrieve an array of files that
are selected and dropped from explorer. No problem, MSDN has an
example.
But what I need to do is to drag and drop strings or structs, and I
need to handle capturing them myself, in a ListBox or ListView. I can
handle a single string easy enough:
On sending side:
private void OnMouseDown()
{
string s = AListBox.SelectedItem.ToString();
}
On receiving side:
private void X_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.Text))
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
}
private void X_DragDrop(object sender, DragEventArgs e)
{
string droppedString = (String)e.Data.GetData(DataFormats.Text);
}
So... How would one convert this to use string arrays rather than just
single strings?