RichTextBox and drag drop events

V

Veeber

I am trying to implement drag drop functionality on a RichTextBox on a
windows form. I have seen many examples using the standard DragEnter
and DragDrop Event handlers however these handlers dont appear for my
System.Windows.Forms.RichTextBox.

Is there something I am missing??
 
G

Guest

Hi
AFAIK,the System.WIndows.Forms.RichTextBox control is a wrapper over the native Rich Text Box control. So all the functionalities of the rich text box control is not available. However it does not mean the drag and drop events / functionalities are not available.The RichTextBox does support the Drag & Drop events. You can implement it like this...

namespace MyNameSpace
{
public class MyClass
{
private System.Windows.Forms.RichTextBox richTextBox1;

public MyClass()
{
richTextBox1.AllowDrop = true;
richTextBox1.DragEnter += new DragEventHandler(richTextBox1_DragEnter);
this.richTextBox1.DragDrop += new DragEventHandler(richTextBox1_DragDrop);
}
private void richTextBox1_DragEnter(object sender,System.Windows.Forms.DragEventArgs e)
{
//Implementation
}

private void richTextBox1_DragDrop(object sender, DragEventArgs e)
{
//Implementation
}
}
}

However, these events are not visible / browsable in the Properties Box and
IntelliSense. This might be because the events are marked with the following
attributes

Hope this helps...

Thanks!
Ramjee Tangutur
Microsoft India Community Star

----- Ellery Familia wrote: -----

which language are you using?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top