Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
- {
- if (e.Button != MouseButtons.Left || (e.Item as TreeNode) == null)
- return;
- try
- {
- string[] fileList = new string[] { (e.Item as TreeNode).Text.ToString() };
- DataObject fileDragData = new DataObject(DataFormats.FileDrop, fileList);
- DoDragDrop(fileDragData, DragDropEffects.Copy);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "DragNDrop Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment