I have a WinForms project based heavily on the DevExpress Windows Forms suite. I am working on a control that appears as below:
I use the term programme to differentiate between training programmes for people, from program, meaning computer program. In the image there are 3 ProgrammeGroup
user controls. Each has a header, with 2 combos, and below that, a ProgrammeDetail
user control with programme details.
When the top, left combo shows a value of Yes or blank, the programme details must be visible, otherwise not. When making a ProgrammeDetail
control invisible, I also set its Height
to zero, and the outer ProgrammeGroup
control shrinks on auto-size.
However, if I set the Yes/No combo on the middle ProgrammeGroup
to No, that
ProgrammeGroup
shrinks, but leaves a gap between the header only middle control and the bottom control. This gap is visible in the following image:
How can I lay my ProgrammeGroup
controls out so that if one shrinks in height, all those below it are moved up, meaning no empty gap. I am hoping that one of the many different panels in the DevExpress WinForms suite can help me do this, but I am stumped at finding one.
Solution to this problem is using FlowLayoutPanel
which automatically align controls inside it next to each other.