locked
How to dynamically height and width change of user control ? RRS feed

  • Question

  • Hi All,

               I want to dynamically change height and width of "User control " when resize  of "User Control"  View window (Not a Window only using User control ) than dynamically change height and width  of user control.

          Thanks


    aniruddha

    Friday, January 4, 2013 6:30 AM

Answers

  • Hi,

    set the HorizontalAlignment and VerticalAlignment properties of the control instance in the main window to Stretch.That will dynamically take care of that.

    Hope this helps.


    One good question is equivalent to ten best answers.

    • Marked as answer by Sheldon _Xiao Wednesday, January 16, 2013 10:29 AM
    Saturday, January 5, 2013 7:59 AM

All replies

  • Hi,

          you can't show the UserControl directly. I assume you are putting that into some window.

    a). don't set any Height and Width of your UserControl.

    b). Then put it that to UserControl to Window. now if you resize your window then usercontrol also will Resize.


    sivakanth trichy

    • Proposed as answer by MI Consultancy Wednesday, May 7, 2014 12:46 PM
    Friday, January 4, 2013 8:10 AM
  • Hi Sivakanth,

                         I am using custom window class for user control. How to changes for re sizing user control window issue.

            Thanks


    aniruddha

    Saturday, January 5, 2013 4:51 AM
  • Hi,

    set the HorizontalAlignment and VerticalAlignment properties of the control instance in the main window to Stretch.That will dynamically take care of that.

    Hope this helps.


    One good question is equivalent to ten best answers.

    • Marked as answer by Sheldon _Xiao Wednesday, January 16, 2013 10:29 AM
    Saturday, January 5, 2013 7:59 AM
  • Hi A.acharya,

    If your issue persists, could you share me a simple sample to reproduce your issue?

    best regards,


    Sheldon _Xiao
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 8, 2013 5:22 AM