StackLayoutPanel has no more place to show the children when there are too many headers … how I can fix this?

后端 未结 2 792
刺人心
刺人心 2021-01-28 10:41

StackLayoutPanel has no more place to show the children when there are too many headers ... how I can fix this?

My structure is of my program is

DockLayoutPanel:

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-28 11:08

    You'll have to explicitly change the size of your StackLayoutPanel. You have to calculate this size yourself.

    If each header is 40 pixels high, for example, and you want the displayed child (son) to have 200 pixels to display, you could call stackLayoutPanel.setHeight((40*numChildren + 200)+"px");

    If you want it to take up all of the available space before scrolling, you'll have to get fancier in your calculations, but it's a flexible plan!

提交回复
热议问题