I am creating a WinForm App(.net3.5) where I display some Client Details. My issue is that we have a directions field that correlates to an Address. To save room I would l
When I require this type of behaviour, I find that the TableLayoutPanel
is useful. You can set the rows and columns to auto-size if holding expandable content - that way, when you hide the content, the row collapses.
If you then have another control (a button, for example), you can use that to control the hidden state of the expandable content.
For example, create a 3 row, 1 column table. Add a fixed size button at the top, and an autosize element in the middle. Make the last row percentage-sized (you need this so that something takes the remaining space when the middle row sizes to zero). Then use your button to change the visible property of whatever you have in the middle row.