locked
Hi Friends, How We Can Do This RRS feed

  • Question

  • IF I ReSize a window form then how to all Control inside form resize according to form size?????
    Tuesday, April 27, 2010 11:15 AM

Answers

  • Set the Anchor property of all the controls to: Top, Bottom, Left, Right
    • Proposed as answer by hassan.nisar Tuesday, April 27, 2010 11:29 AM
    • Marked as answer by kanchan singh Tuesday, April 27, 2010 11:40 AM
    Tuesday, April 27, 2010 11:28 AM
  • you can use the anchor property of each control

    • Proposed as answer by hassan.nisar Tuesday, April 27, 2010 11:30 AM
    • Marked as answer by kanchan singh Tuesday, April 27, 2010 11:37 AM
    Tuesday, April 27, 2010 11:28 AM
  • Hi,

     Put the controls inside a tablelayoutpanel control and set its propery as autosize true. Dock property to fill.

    set all the controls autosize and dock property as the same. Also set the autosize mode to GrowAndShrink.

    Now the controls will resize according to the form....


    -- Thanks Ajith R
    • Marked as answer by kanchan singh Tuesday, April 27, 2010 11:37 AM
    Tuesday, April 27, 2010 11:32 AM

All replies

  • Set the Anchor property of all the controls to: Top, Bottom, Left, Right
    • Proposed as answer by hassan.nisar Tuesday, April 27, 2010 11:29 AM
    • Marked as answer by kanchan singh Tuesday, April 27, 2010 11:40 AM
    Tuesday, April 27, 2010 11:28 AM
  • you can use the anchor property of each control

    • Proposed as answer by hassan.nisar Tuesday, April 27, 2010 11:30 AM
    • Marked as answer by kanchan singh Tuesday, April 27, 2010 11:37 AM
    Tuesday, April 27, 2010 11:28 AM
  • Hi,

     Put the controls inside a tablelayoutpanel control and set its propery as autosize true. Dock property to fill.

    set all the controls autosize and dock property as the same. Also set the autosize mode to GrowAndShrink.

    Now the controls will resize according to the form....


    -- Thanks Ajith R
    • Marked as answer by kanchan singh Tuesday, April 27, 2010 11:37 AM
    Tuesday, April 27, 2010 11:32 AM
  • sorry but if i run my project on different screen resolution then ho to form set automatically according to screen resolution


    Tuesday, April 27, 2010 11:32 AM
  • That would be really tough......

    Because, the form is painting using the unit as Pixel.... when the resolution changes, the form will draw as it is...

    I think you will have to have a logic to identify the resolution and reduce all the control's width and height according to that, by some calculations with it.

    Something like,

     button2.Width=actualWidth/(1024-currentresolution);//Just an example....

     


    -- Thanks Ajith R
    Tuesday, April 27, 2010 11:43 AM
  • Ya it's Possible But if U have any Another Way.

    plz tell me.

    Tuesday, April 27, 2010 11:51 AM