Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HI

Anybody can help me how to design form lable drag & drop control using mouse

Please post the code

Advance Thanks for going to taken effects on my request.

regards
Shyam
Posted
Comments
Just eg 13-Mar-13 3:45am    
what will drag? text on label or label?

1 solution

What is the overall goal of the application ?
Does it need to be an actual label control you are dragging,
or is it ok to simply drag some text around within some canvas ?

If you are open to using a 3rd party .NET component, I think the MetaDraw .NET Winforms control may be helpful to you. MetaDraw looks like a scrollable zoomable picturebox on your form but it allows you to compose an image of multiple elements - such as multiple text objects ( labels ) . You can add a few text objects ( as well as shapes and images ) within MetaDraw or you can allow the user to add the text himself. You can then allow him to select and grab any text object and move it around. When done you can read off the positions of the text objects. You can also print the overall layout, as well as save this. When saving you can save to either a standard image format, or to a format that allows you to reload and continue to drag the text objects around.

As an example see the following web page that was created using MetaDraw -
http://www.bennet-tec.com/btproducts/MetaDraw/WebSamples/Drawing/md3_demo.htm[^]

Because this web page was done with the OCX version of MetaDraw you should use only IE for viewing this web page. ( For your application you would use the MetaDraw .NET edition )
In this web page you can test this out directly in your browser. Hit the Text button, click in MetaDraw and add some text, then hit the Select button and click and drag the text around.

Of course this same project can be done as a VB.NET Winforms project using the .NET edition of MetaDraw. The VB.NET code is very simple. If you look at the html/vbscript sources for this web page, the VB.NET code would be almost the exact same and of course you can customize this to your needs.

I hope this is helpful
Please note - My company is the publisher of MetaDraw
so this is not entirely unbiased - I do think this will meet
your needs really quick and easy but I want you to know where I'm coming from up front.

Jeff
Bennet-Tec Information Systems

** Please include a copy of this message with any reply.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900