Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Proportional Position of Controls RSS

3 replies

Last post Sep 18, 2008 08:14 AM by simbuaarumugam

(0)
  • kahlua001

    kahlua001

    Member

    5 Points

    13 Posts

    Proportional Position of Controls

    Sep 18, 2008 05:37 AM | LINK

    Hi, I'm a newbie and not sure the best way (or if there are any existing features that might work) to do this. I have a SL project that has a canvas?, in this canvas which is grows to the full width and height of the available browser area. The user can drag custom controls on this canvas, drag and drop to new coordinates. My issue is if they the browser full screen, then dragged a control to a part of the canvas that when minimized, the control is now all the way off the canvas. I know the position starts from the top right corner, what is the best way to proportionally reposition the controls on the canvas based on the current size of the canvas?

  • HarshBardhan

    HarshBardhan

    Star

    10118 Points

    1749 Posts

    Re: Proportional Position of Controls

    Sep 18, 2008 07:17 AM | LINK

    Hi,

    There are some event which fires on Browser Resize.

    You Can write Your logic their so it will Be Propertional for that..

    you can check browser Height and Width an d change your Main canvas Height and Width..

    You can change Scalex and and ScaleY of your Canvas so all controls will be Resized accordingly to its size..

     

    Mark as answer if this post answered your question.

    Harsh Bardhan
  • surbhiydv

    surbhiydv

    Participant

    1134 Points

    218 Posts

    Re: Proportional Position of Controls

    Sep 18, 2008 08:10 AM | LINK

    Hi Kahlua001

    You can use Grid layout instead of Canvas for better results. Try these links for further knowledge:

    http://www.cynergysystems.com/blogs/page/josefajardo?entry=live_messenger_done_with_silverlight1

    http://msdn.microsoft.com/en-us/library/cc189087(VS.95).aspx

     

    ('Mark As Answer'......if it helps you)

  • simbuaarumugam

    simbuaarumugam

    Participant

    1182 Points

    405 Posts

    Re: Proportional Position of Controls

    Sep 18, 2008 08:14 AM | LINK

     HI kahlua

    better you use blend for positioning user controls

    SimbuAarumugam India
    http://simbusoftwareengineer.blogspot.com
    (Mark As Answer If its Satisfy your needs)