Sai Stuff to Developers

May 26, 2008

Drag and Drop Feature In Windows .Net Form

Filed under: DotNet — tosaik @ 12:46 pm

On the browser we can develop a Drag and Drop feature using JavaScript, but what the same Drag and Drop feature can we implement in Windows Form? Yes we can how we will learn now.


Please Follow the Steps below where I am demonstrating this concept using simple Example.


1)      Open visual Studio’s IDE and create a new windows Form using any language which support s by .NET Framework.

2)      On the new for add two listbox controls from toolbox and name it as ListSource and ListTarget.

3)      Now bind the ListSource Listbox to a Datasource (My motive is to fill the Listbox with some data).

4)      In Listsource properties set AllowDrop to True, this will create a new set of events for the control. In the event list of this control doubleClick on Mousedown Event and write this code:




5)      In properties of ListTarget Control Set AllowDrop to True.

6)      In properties of ListTarget Control, go to Event block and double Click on DragEnter Event and write this code:


e.Effect = DragDropEffects.Copy


7)      In properties of ListTarget Control, go to Event block and double Click on DragDrop Event and write this code:




Now Execute or press F5 to see the Out put now select one item in ListSource listbox and drag It to ListTarget listbox  it will add one item in Target list box.


This is a simple example I didn’t explained about what is this DragDropEffect Enumerations, for now  just use as I shown I will explain in my next post.


I hope this post helps U..,

Thank you  J




  1. KUTHUN ALA AHES RE TU????????

    Comment by Raju — May 26, 2008 @ 1:11 pm | Reply

  2. Hai this Logic is cool and usefull to me thanx.

    Comment by santoshbook — May 26, 2008 @ 4:23 pm | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: