Hi:
I am having a problem moving a treenode in a treeview to a listbox. The code is pretty straight forward. I just can't figure out why. Here is my code:
In window form's constructor I have:
this.ScriptTestTreeView.ItemDrag += new ItemDragEventHandler(ScriptTestTreeView_ItemDrag);
this.ActiveScriptListBox.DragEnter += new DragEventHandler(ActiveScriptListBox_DragEnter);
and then the handler functions:
private void ScriptTestTreeView_ItemDrag(object sender, ItemDragEventArgs e)
{
//MessageBox.Show("drag occur.");
ScriptTestTreeView.DoDragDrop(e.Item, DragDropEffects.Link);
}
void ActiveScriptListBox_DragEnter(object sender, DragEventArgs e)
{
//throw new NotImplementedException();
MessageBox.Show("drag enter!"+e.Data.GetData(DataFormats.StringFormat));
}
I noticed that when I was trying to drag a node from treeview, a prohibit sign showed up even though I set the allowdrop of treeview to true.
When I move the mouse to listbox, the message box show up but then the whole program freeze.
Is there a way to debug this problem? Did I do something wrong here?
Thanks.