A Basic Drag and Drop Sample
Version Compatibility: Visual Basic.NET
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.
Instructions: Click the link below to download the code. Select ‘Save’ from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.
(Visited 48 times, 1 visits today)