简体   繁体   中英

Winforms drag and drop labels in the form

I have few lables in windows form. I want let user can drag and drop anywhere in the form. So that I can store their position in registry or database to restore them next time. I read the question I need a drag and drop control for C# winforms

But it didnt help me properly when I used DoDragDrop method on mousedown of the labels and OnDragOver event of the form.

Edit

To store the postion and restore the position is not I am looking here, Only the simple code how to drag/drop labels in winforms without using libraries or third party controls.

Hope this might help: http://www.java2s.com/Code/CSharp/GUI-Windows-Form/Draganddropimagetoanotherwindow.htm

Although this is for Image but I hope the same can be done for labels too.

:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM