How to create a dragable canvas?

Hi,

as the title, currently I only need to drag and drop the canvas on another canvas.

show me some advice

thanks.




Answer this question

How to create a dragable canvas?

  • ******

    There are a number of ways in which you can get this effect. If you want to do this within a single application, adding mouse listener events (down, move, up) and detaching and reattaching the Canvas is the easiest solution.

    If you want cross-process drag/drop and something a bit more sophisticated (like the ability to both drop-copy and drop-cut), I walk through how to get this done in my blog at http://blogs.msdn.com/marcelolr/archive/2005/05/03/414490.aspx.

    The code samples are from an older CTP - feel free to post comments if you have problems updating to the latest API syntax.


  • Fex

    I've started a series of posts on drag/drop that should cover some of this here: http://blogs.msdn.com/marcelolr/.

    The first post should cover something similar to the 'preview' functionality: http://blogs.msdn.com/marcelolr/archive/2006/03/02/542641.aspx. It moves shapes around in a Canvas (but you can add other elements, like buttons or text boxes, and it still does its magic).


  • ModemGeek

    Hi

    I had recently posted a similar query, but didnt hear from anyone

    Can u elaborate on how I can detattach / attach a canvas within my window I want to be able to see my object move as I drag it from one location and dock it in another.

    thanks

    amit


  • How to create a dragable canvas?