Skip to main content

Microsoft Silverlight

Answered Question Drag and Drop in a proper placeRSS Feed

(0)

antonio.jr
antonio.jr

Member

Member

2 points

5 Posts

Drag and Drop in a proper place

 Hy guys,

I´m just starting using Silverlight 2 and I´d like to know how can I drag and drop an image into an exact place within the canvas. Just like you do in an Album. If it´s not the right place, avoid the image of being dropped.

If it´s not too much, is it possible to use that turn page effect (used in a sample) to drop the images into the pages?

Thanks in advance

HarshBardhan
HarshBar...

Star

Star

9908 points

1,719 Posts

Answered Question

Re: Drag and Drop in a proper place

Hi,

you Can Handle Mousemove,MouseLeftButtondown and MouseLeftButtonUp event and you can drag and Drop a Control in your Page.

check this Sample for Details.

http://www.dotnetcurry.com/ShowArticle.aspx?ID=198

Mark as answer if this post answered your question.

Harsh Bardhan

antonio.castro.jr
antonio....

Member

Member

10 points

6 Posts

Re: Re: Drag and Drop in a proper place

Hi Harsh,

Thanks for your interest. I´ve already seen this link. I know how to drag UIElements on the Canvas. What I´m trying to do is to only allow the dropping in a right place, lets say, in an special panel.

I also know that I´ll have to code something in the MouseLeftButtonUp event. I just don´t know how to acomplish it.

I´m trying to figure out.

Thanks

HarshBardhan
HarshBar...

Star

Star

9908 points

1,719 Posts

Re: Re: Drag and Drop in a proper place

As you are trying to drop at a special Panel so in that case You have to Remove this control from your Canvas collection and Add that to Another Panel's collection..

Mark as answer if this post answered your question.

Harsh Bardhan

antonio.castro.jr
antonio....

Member

Member

10 points

6 Posts

Re: Re: Re: Drag and Drop in a proper place

Is there any example of that?

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities