Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Find control position RSS

3 replies

Last post Oct 19, 2007 06:49 PM by balla

(0)
  • MrCyprom

    MrCyprom

    Member

    256 Points

    112 Posts

    Find control position

    Oct 19, 2007 04:54 PM | LINK

    Hi,

    I've already read it in this forum but I can't find it anymore.

    I try to get (and modify) the position of a MediaElement in a Canvas, but how can I get its position ?

    Regards.

    Romain Jestin
    Brainsonic The Rich Media Factory
  • jasonxz

    jasonxz

    Participant

    1787 Points

    557 Posts

    Re: Find control position

    Oct 19, 2007 04:59 PM | LINK

    Well, if all you want is its position relative to its containing Canvas, all you need is:

    mediaElement.GetValue(Canvas.TopProperty);

    mediaElement.GetValue(Canvas.LeftProperty);

    If you want the position relative to the SilverlightPage, you'll have to use the same code while walking up the control tree.

  • MrCyprom

    MrCyprom

    Member

    256 Points

    112 Posts

    Re: Find control position

    Oct 19, 2007 05:04 PM | LINK

    Hi,

    Thanks.

    Romain Jestin
    Brainsonic The Rich Media Factory
  • balla

    balla

    Member

    674 Points

    200 Posts

    Re: Find control position

    Oct 19, 2007 06:49 PM | LINK

    Hint: you should mark jasonxz's post as the answer and not your own post.