How can I enable dragging from the Tree component and the List box component?
The TextBox component has an AllowDrop and RichText has EnableAutoDragDrop... I wish there were consitent property names for this.
I want to be able to drag items from either a tree or a list box and drop them onto either a text box or a Rich Edit box.
I have found a few articles but none that answer this specific qustion. Surely its possible to enable dragging from a Tree View component?
Thanks
Jinwah
Loading
Jinwah SerapisPosted Oct 17, 2007, 4:38 AM
The very specific thing I want to do is to drag items from a tree view and drop the text in a rich text edit box at the position of the cursor. So just in case you could include this in your update that would be great!!!
Coming from a Java development background writing C# code is no problem but the Visual Studio and visual components remain elusive to use as they are not intuitive as soon as you want to do something like this.
Mike GoldPosted Oct 17, 2007, 12:40 AM
dragging is automatically enabled by handling the event correctly in itemdrag and calling dodragdrop inside the event handler. AllowDrop just allows you to drop an item into a control and not drag from it.
Although this article is old, check it out, it will point you in the right direction. I'll see if I can update it in the near future.
http://www.c-sharpcorner.com/UploadFile/mgold/DragandDropRevisited11292005062734AM/DragandDropRevisited.aspx