Drag and drop interface

I am trying to create a drag and drop interface like the one you have in visio. This way you can drag objects from the library into the field.

Is there a function to do this or should I do it myself?

Thanks, Jerodev.

+4
source share
4 answers

Here's a good explanation of drag and drop: Two ListBoxes - an example of drag and drop

+5
source

As other people have noted, your friends are here: DragDrop, DragOver, DragLeave and DragEnter. But be sure to include "AllowDrop" for the item that will receive the data. Here is a second great example: http://www.jonasjohn.de/snippets/csharp/drag-and-drop-example.htm

This is for files, but you can easily see how this idea works, set up the DataFormat in GetDataPresent to be what you drag and drop into your object, and exit!

+3
source

Yes, there are ways that you can easily implement, look for DragDrop, DragEnter, DragOver

+2
source

If you are open to using WPF, there is a fantastic tutorial here . This is a four-part series for creating a β€œdesign canvas” in WPF. Part two implements the drag and drop function using the toolbar. It is very well written and you end up with a user interface that is very similar to Visio.

+2
source

Source: https://habr.com/ru/post/1381145/


All Articles