locked
resize picture box RRS feed

  • Question

  • Hi.. i have a form.. that opens like a dialog box.  On this form is a tablelayoutpanel, i have my picturebox in row 0 spaning 3 columns.  What I would like to be able to do.. as the user resizes the form, make row 0 in the lay grow.  I am thinking that will cause my picture box to grow a bit too and the user can get a better look at the image.

    Any idea's?

              Brian

     

    Thursday, December 9, 2010 8:00 PM

Answers

  • Hello LandLord323,

    Thanks for your post.

    (1) You can merge cells in the TableLayoutPanel control by setting the ColumnSpan or RowSpan properties on a child control.

    If you want the picturebox spans 3 columns, you could set the ColumnSpan property of the picturebox equals to 3.

    (2) If I understand your problem clearly, do you want the image in picturebox, the tablelayoutpanel and resize automatically according to the resize of the form? If so, you can use the Anchor property for this.

    Enable tablelayoutpanel and picturebox anchor to left, top, right and bottom. Then the panel and image will resize relative to the form.

    Hope it helpful.

    If you have any concerns, please feel free to follow up.

    Best regards

     


    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Liliane Teng Friday, December 17, 2010 7:07 AM
    Friday, December 10, 2010 9:28 AM
  • how big is the picture?

    if you set your picturebox.sizemode to autosize it'll resize to the image, + if you set your tlp.autosize property to true it'll show the whole picturebox

    • Marked as answer by Liliane Teng Friday, December 17, 2010 7:07 AM
    Thursday, December 9, 2010 8:59 PM

All replies

  • how big is the picture?

    if you set your picturebox.sizemode to autosize it'll resize to the image, + if you set your tlp.autosize property to true it'll show the whole picturebox

    • Marked as answer by Liliane Teng Friday, December 17, 2010 7:07 AM
    Thursday, December 9, 2010 8:59 PM
  • Hello LandLord323,

    Thanks for your post.

    (1) You can merge cells in the TableLayoutPanel control by setting the ColumnSpan or RowSpan properties on a child control.

    If you want the picturebox spans 3 columns, you could set the ColumnSpan property of the picturebox equals to 3.

    (2) If I understand your problem clearly, do you want the image in picturebox, the tablelayoutpanel and resize automatically according to the resize of the form? If so, you can use the Anchor property for this.

    Enable tablelayoutpanel and picturebox anchor to left, top, right and bottom. Then the panel and image will resize relative to the form.

    Hope it helpful.

    If you have any concerns, please feel free to follow up.

    Best regards

     


    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Liliane Teng Friday, December 17, 2010 7:07 AM
    Friday, December 10, 2010 9:28 AM
  • Hello LandLord323,

    I am writing to check the status of the issue on your side.  Would you mind letting us know the result of the suggestions? 

    If you need further assistance, please feel free to follow up.

    Best regards


    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, December 15, 2010 7:51 AM