0

I am trying to create my own custom popup/modal dialog similar to something you'd see on a webpage. The problem I'm having is that I need the form to grow in height if the content (the text) gets longer.

enter image description here

I followed another answer here on SO to keep my controls automatically centered.

The Icon (PictureBox), Title (Label), Content Text (Label) and Buttons are hosted inside a FlowLayoutPanel, and that is hosted inside a 1x1 TableLayoutPanel.

As you can see in the picture, the message under the title is getting cut off. How can I make the form grow in height if the message is something that doesn't fit in the default size? Or what can I do to make everything "auto size" ?

Jimi
  • 29,621
  • 8
  • 43
  • 61
The Newbie
  • 379
  • 4
  • 18
  • 2
    You have to set the TLP's Row(s) that you want to cause the Form to **Grow** or **Shrink** to `AutoSize`. So an auto-sizing Form can **Grow** and **Shrink** when its content does. The auto-sizing TLP container also needs to, guess what, **Grow** and **Shrink** based on its content – Jimi Nov 01 '22 at 03:53
  • 1
    There's a description of the procedure here: [Center multiple rows of controls in a FlowLayoutPanel](https://stackoverflow.com/a/54565075/7444103). The Parent Form is not meant to auto-size there (only the hosting Panel), but what you need to change should be clear enough – Jimi Nov 01 '22 at 03:53

0 Answers0