I am wondering if anyone has any idea how to make the controls stack and fill up the available space left by a control if the control is hidden or removed from the UltraGridBagLayoutPanel.
Example:
[Textbox 1]
[Textbox 2]
[Textbox 3]
[Textbox 4]
[Textbox 5]
If I hide [Textbox 3] as of now, it will disperse the space left equally and pad the remaining text boxes with the space. However, I would like it to do this…
[Textbox 1]
[Textbox 2]
[Textbox 4]
[Textbox 5]
Where all the text boxes will move up and [Textbox 4] will completely consume the space left by [Textbox 3].
Any ideas?
You can add a panel for each textbox that you might hide to the GridBagLayoutPanel after the TextBox controls and set it’s visibility to be the opposite of the TextBox visiblity. As long as the Panel is the same size as the TextBox then it will reserve the same amount of space and the text boxes will move as you would like.