I'd like to achieve the following and was looking for a sample/tutorial but couldn't really find anything:
I have C# Winforms application, which has multiple Forms within the same process. I'd like to be able to drag & drop items within and between forms and would like to provide some custom painted visualization of the item being dragged.
For example, my IM app shows the effect that I'd like to achieve:
Thanks,
Tom
You actually physically have to drag a control with the mouse.
For example: http://blogs.msdn.com/b/adamroot/archive/2008/02/19/shell-style-drag-and-drop-in-net-wpf-and-winforms.aspx
Related
I can not figure out how to graphically representate objects. I want some kind of rectangles, maybe even buttons that ill dynamicaly generate, the user will be able to click them for action and change their order. I will use WPF or Windows Forms Apps.
This question is a follow up question to post:
Is it possible to move a composite control by clicking on one of its
daughter controls?
Is it possible to animate the actual drag and drop movement. I.E. instead of having just a mouse pointer and a small rectangular box underneath, display something that looks like the composite control?
The first approach is to simply create an static icon that looks like the composite control and for example embed it in an application as a resource. Then you have to use it as a custom drag and drop icon. This answer Can I choose a custom image for C# Windows Application Drag Drop functions explains how to do that.
The second approach is more complex. Instead of using a static icon you can create an icon dynamically based on the current content of a control being dragged. The following answer C# Drag-and-Drop: Show the dragged item while dragging explains it in more details.
I am very new to WPF and I've tried to find the guides and tutorials about this but haven't found exactly I wanted.
This post has been the closest, a solution for moving an item between two different windows (in the same project). However this limits any other drag and drop features you want to do (e.g. within a canvas).
In a similar fashion, I want to move something (an image, within a listbox specifically) from one app to another (when both are running at the same time).
Any help or tips would be appreciated, thank you!
I want to have drag and drop reordering in a list box. Just like the home screen of the phone does. I.e long press will select the item, then we should be able to drag and drop it to another location. How can this be done? Are there already any controls available?
Environment is Windows Phone 7.1
Here is a WPF solution for two listboxes, bot from this you should be able to make minor modifications and apply it on your solution.
I am looking for WPF MVVM solution to drag and drop within as well as accross different listboxes.
Drag and Dropping Within Listboxes would update the sequence or Order.
I came across the Gong Soloution one which unfornately does not support both.
Also dragging something off (into nowhere) a listbox would remove the item would be really nice to have.
I would highly recommend looking into Bea Stollnitz's article on Drag/Drop. If her drag/drop code doesn't do what you need, it is very easy to add on to