Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

set canvas.top programmatically? RSS

1 reply

Last post Oct 16, 2007 04:00 PM by cookendorfernick

(0)
  • Muller2

    Muller2

    Member

    275 Points

    80 Posts

    set canvas.top programmatically?

    Oct 16, 2007 03:15 PM | LINK

    Hi,

    Can anyone quickly tell me how to set the canvas.top value programmatically from Javascript?

    Thanks,

     Al

  • cookendorfernick

    cookendorfer...

    Member

    424 Points

    99 Posts

    Re: set canvas.top programmatically?

    Oct 16, 2007 04:00 PM | LINK

    muller2

    Hi,

    Can anyone quickly tell me how to set the canvas.top value programmatically from Javascript?

    Thanks,

     Al

    Say you were clicking on the textblock with function MouseLeftButtonDown="Click". This is how you would write the code to change its canvas.top position.

    function Click(sender, mouseEventArgs)

    {

    sender[
    "Canvas.Top"] = "500";

    }

    -Nick

    Also, please "Mark As Answer" if this answered your question.