给 RichTextBox 添加拖放事件

前几天在做一个 Win Form 程序用到了 RichTextBox 控件,不知道为什么,在 RichTextBox 控件属性的事件列表中没有“拖放事件”;找了很久才找到解决办法,原来 RichTextBox 控件“拖放事件”通过代码添加。
// 给 RichTextBox 添加拖放事件:
this.richTextBox1.AllowDrop = true;
this.richTextBox1.DragEnter += new DragEventHandler(RichTextBox1_DragEnter);
this.richTextBox1.DragDrop += new DragEventHandler(RichTextBox1_DragDrop);

posted on 2007-12-07 12:29  大豆男生  阅读(931)  评论(1编辑  收藏  举报

导航