I want to be able to drag a treeview node, drop it on to a rich edit box and
when that event occures, insert some text into the rich edit at the location
that the node was dropped.

Possible? Any hints on how to do this, as I'm not sure where to start.

RE: Drag a tree view node on to a richedit by StealthyMark

StealthyMark
Mon Apr 04 08:11:02 CDT 2005

That's simple.

// the handler for the Treeview.ItemDrag event
private void treeview_ItemDrag(object sender,
ItemDragEventArgs e)
{
// create the text you want to drop here
string text = CreateYourTextNow(treeview.SelectedNode);

// perform the drag-drop
DoDragDrop(text, DragDropEffects.Copy);
}

Note: For your RichTextBox, you may have to set AllowDrop to true.

Mark Rockmann

"Jeremy Chapman" wrote:

> I want to be able to drag a treeview node, drop it on to a rich edit box and
> when that event occures, insert some text into the rich edit at the location
> that the node was dropped.
>
> Possible? Any hints on how to do this, as I'm not sure where to start.
>
>
>

Re: Drag a tree view node on to a richedit by Jeremy

Jeremy
Mon Apr 04 10:26:57 CDT 2005

Magnificent!

thanks.

"StealthyMark" <StealthyMark@discussions.microsoft.com> wrote in message
news:E23AA344-A060-4D89-9A85-46FCA018DF86@microsoft.com...
> That's simple.
>
> // the handler for the Treeview.ItemDrag event
> private void treeview_ItemDrag(object sender,
> ItemDragEventArgs e)
> {
> // create the text you want to drop here
> string text = CreateYourTextNow(treeview.SelectedNode);
>
> // perform the drag-drop
> DoDragDrop(text, DragDropEffects.Copy);
> }
>
> Note: For your RichTextBox, you may have to set AllowDrop to true.
>
> Mark Rockmann
>
> "Jeremy Chapman" wrote:
>
> > I want to be able to drag a treeview node, drop it on to a rich edit box
and
> > when that event occures, insert some text into the rich edit at the
location
> > that the node was dropped.
> >
> > Possible? Any hints on how to do this, as I'm not sure where to start.
> >
> >
> >