本文介绍了StackLayoutPanel没有更多的地方来显示孩子时,有太多的标题......我该如何解决这个问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的程序结构是

我的程序结构是



DockLayoutPanel:
East,
Wets,
Center ----> ScrollPanel ----> StackLayoutPanel



在中间我有一个StackLayoutPanel,问题是当我把
标题放入堆栈时很多没有地方打开和滚动不
更新它们的大小到如果它有
的空间并且超出范围,就会打开标题的儿子。



知道他能为中心做些什么,总是可以用
scrollpanel甚至是stacklayoutpanel的一个儿子打开?因为正如我所说,如果
我把很多StacklayoutPanel头文件放在
打开的位置并且我把它放在一个滚动面板中StackLayoutPanel
没有空间来调整大小滚动包含它。



问候
Jero。

解决方案

您必须明确更改StackLayoutPanel的大小。您必须自己计算这个尺寸。



例如,如果每个标题的高度为40像素,并且您希望显示的子项(子项)要显示200个像素,你可以调用 stackLayoutPanel.setHeight((40 * numChildren + 200)+px);



希望它在滚动之前占用所有可用空间,在计算中你必须更加有趣,但这是一个灵活的计划!


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:East,Wets, Center ----> ScrollPanel ----> StackLayoutPanel

In the middle I have a StackLayoutPanel, the issue is when i putheaders in the stack Many Have No place to open and scroll Does Notupdated their size to the son of the header That Opened if it hasspace and is out of range.

Would know how he could do for the center can always be with ascrollpanel even a son of stacklayoutpanel open? because as I said, ifI put a lot in my StacklayoutPanel Headers has no place for you toopen and as much as I wrap it in a scrollpanel to StackLayoutPaneldoes space to resize the scroll that contains it.

GreetingsJero.

解决方案

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!

这篇关于StackLayoutPanel没有更多的地方来显示孩子时,有太多的标题......我该如何解决这个问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 19:43