C#-APP: Drag And Drop On RichTextBox - How To Detect Drag Source

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Itanium
    New Member
    • Nov 2007
    • 7

    C#-APP: Drag And Drop On RichTextBox - How To Detect Drag Source

    Hi all!

    I'm getting in some trouble with Drag and Drop operations.

    I have a RichTextBox inside a Form. I want to allow text moving inside the RichTextBox itself, which is achieved by simply enabling the EnableAutoDragD rop property... On the other hand, when dragged text comes from an external application (or another component in my app) I want to apply some extra formatting (put the dropped text in bold for example), or simply not allow this kind of Drag And Drop operation.

    I'm handling events RichTextBox_Dra gEnter and RichTextBox_Dra gDrop, but cannot find a way to distinguish the Drag Source to perform the proper action depending on if it is a RTB self DragDrop or external DragDrop. I think the DragEventArgs doesnt provide such info.

    Any help appreciated.
Working...