Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drag & Drop - Part 2
Message
From
10/07/2009 03:09:00
 
 
To
09/07/2009 15:03:49
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01411209
Message ID:
01411348
Views:
24
Hi,

Looks like Silverlight - this sort of thing is pretty trivial in WPF using Measure()/Arrange()
Best,
Viv


>I am not answering your question and have not really paid attention about your project. I was wondering however if you had seen this website that allows you to drag and drop components from one place to another. Each time you drag something the columns were they are placed and were they came from are all re-arranged. It is a pretty cool feature and some remarkable code work. It is at:
>www.dropthings.com
>
>Also, the code is all availble and a book was written (Building a web 2.0 Portal with ASP.Net 3.5) on how it is all done. Pretty good stuff.
>Tim
>
>>I finally was able, using Bonnie's code, to get my drag & drop working. I still have some problems though.
>>
>>I placed 2 panels on a form. The panel to be dragged is called PickedUpControl and the target is called TargetArea:
>>
>>
>>public partial class Form1 : Form
>>{
>>    Cursor DefaultCursor;
>>
>>    public Form1()
>>    {
>>        InitializeComponent();
>>        DefaultCursor = this.Cursor;
>>    }
>>
>>    private void PickedUpControl_MouseDown(object sender, MouseEventArgs e)
>>    {
>>        Cursor oCursor = new Cursor(@"C:\Projects\Samples\DragDrop\hpoint.cur");
>>        this.Cursor = oCursor;
>>
>>        this.PickedUpControl.DoDragDrop(sender, DragDropEffects.Copy);
>>    }
>>
>>    private void TargetArea_DragEnter(object sender, DragEventArgs e)
>>    {
>>        e.Effect = DragDropEffects.Copy;
>>    }
>>
>>    private void TargetArea_DragDrop(object sender, DragEventArgs e)
>>    {
>>        this.TargetArea.Controls.Add(this.PickedUpControl);
>>
>>        Point xy = this.TargetArea.PointToClient(new Point(e.X, e.Y));
>>        this.PickedUpControl.Location = xy;
>>    }
>>
>>    private void PickedUpControl_GiveFeedback(object sender, GiveFeedbackEventArgs e)
>>    {
>>        e.UseDefaultCursors = false;
>>    }
>>
>>    private void PickedUpControl_DragLeave(object sender, EventArgs e)
>>    {
>>        this.Cursor = DefaultCursor;
>>    }
>>}
>>
>>
>>1). I can't seem to get the cursor to reset to default after the drag/drop is done.
>>2) The dragged pane is removed and placed in the target. How do I copy it instead?
>>
>>Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform