drag and drop sample

In Visual Studio.Net create a Windows Application project and add a form to the project. Add two textbox controls named tbDragFrom and tbDragTo. Set the Text property of tbDragFrom to "Drag From Text" or anything you want, and set the text property of tbDragTo to an empty string. You have to allow drag and drop operations on the controls. With a textbox and most other controls this is done by setting their AllowDrop property to True. You then start a drag and drop process on the mouse down event by using the DoDragDrop Event. This takes 2 arguments, the data to stuff into the clipboard and the visual effect to show the user. This can be one or multiple effects, such as DragDropEffects.Move, DragDropEffects.Move or DragDropEffects.Copy. The rest of the code is pretty self explanatory.


Attachments

  • drag and drop sample (22524-1801-DragAndDropSample1.rar)
  • Comments

    No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: