Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > drag and drop
 

drag and drop

I need to know more about how to drag and drop in windows forms (vb.net)? (For example a button) also how to create a custom control (for example a button with one textbox) and how to use it and invoke it in the vb.net code?

MonaAli  Friday, April 18, 2008 11:47 AM

Hi MonaAli,

I am not sure about your problem, what did you mean by “drag and drop�

If you mean drag and drop operations like you do in the Windows Explorer, you can enable the AllowDrop to true for the controls and help DragEnter event, DragOver event, DragDrop and the corresponding events. Here is a sample for your reference:

If you mean want to enable the design time features like you do in Visual Studio, there two option for you. One is use the DesignSurface to enable the design time features, here is a sample for your reference:

The other is to create a helper class to do the stuff. Here is a sample for your reference:

Hope this helps.
Best regards.
Rong-Chun Zhang

Rong-Chun Zhang  Thursday, April 24, 2008 6:34 AM

Hi MonaAli,

I am not sure about your problem, what did you mean by “drag and drop�

If you mean drag and drop operations like you do in the Windows Explorer, you can enable the AllowDrop to true for the controls and help DragEnter event, DragOver event, DragDrop and the corresponding events. Here is a sample for your reference:

If you mean want to enable the design time features like you do in Visual Studio, there two option for you. One is use the DesignSurface to enable the design time features, here is a sample for your reference:

The other is to create a helper class to do the stuff. Here is a sample for your reference:

Hope this helps.
Best regards.
Rong-Chun Zhang

Rong-Chun Zhang  Thursday, April 24, 2008 6:34 AM

You can use google to search for other answers

Custom Search

More Threads

• always can't connect Terrarium server
• Problems with Server
• FileNotFoud Exception???
• Audit Trail using C#.Net - Winforms
• Can not receive animals
• Changing readonly property of all textboxes on form
• Clarification
• Error while executing PocketpC Taskvision
• Server Install Error: The parameter is incorrect. (taskvisionsource_1.1.0.0.msi)
• Vector.Rotate rotates in which direction?