TX Text Control .NET for Windows Forms Documentation

File Drag and Drop

Three .NET events are involved when implementing File Drag and Drop:

  • DragEnter: Occurs when an object is dragged into the drop target's bounds. At this point, the application checks if it can accept the file.
  • DragOver: Occurs when the mouse is moved while over the drop target. Here, the mouse pointer is changed to inform the user if the file can be dropped.
  • DragDrop: Occurs when the user releases the mouse button over the drop target. The file is then loaded.

If you drop a file on the text window, these events will occur in TX Text Control. However, if the file is dropped outside of TX Text Control's bounds, e.g. on the application's toolbar, the events will occur in the application's form. This offers the opportunity to provide different actions, depending on where exactly a file is dropped. Microsoft Word 2007(R), for instance, will load a file that is dropped onto its toolbars, but not if dropped onto the text area.

<< Previous Next >>

 
 
 

Products

Support

Downloads

Corporate

Buy Now