我制作了这张显示控件的图像。最上面的一个是 ListView
,其他是 ListView
控件以及其他控件。
但我不知道如何将它们布局成这样。
目前,我为每个 ListView
使用 3 个 DockPanels
,其中顶部的一个使用 Top VerticalAlignment
,其他的使用 Bottom 作为 VerticalAlignment
、左和右(对于水平对齐)。
但是当我查看它时,其他 2 个控件出现在顶部 ListView
之后的右侧。当我将顶部 DockPanel
缩放到一半大小时,我可以看到这一点,然后显示其他 2 个 DockPanel,它们连接到顶部 DockPanel 的右侧。
关于如何解决这个问题有什么想法吗?
I made this image that shows the controls. The top one is a ListView
and the others are ListView
controls as well with additional controls.
But I can't figure out how to layout them to look like that.
Currently I use 3 DockPanels
for each ListView
where the top one uses Top VerticalAlignment
, the others use Bottom for VerticalAlignment
, Left and Right (for HorizontalAlignment
).
But when I look at it, the other 2 controls appear after the top ListView
to its right side. I can see this when I scale the top DockPanel
to half the size, then the other 2 DockPanels show up, attached to the top DockPanel's right side.
Any ideas on how to fix this?
发布评论
评论(3)
这个怎么样?
网格没有固定的宽度或高度,并且应该容纳您添加的任何控件。
初始窗口
调整大小的窗口
编辑以响应评论
如果您想在顶部面板中显示进度条,只需使用:
How about this?
The grid has no fixed widths or heights and should accommodate whatever controls you add.
Initial window
Resized window
EDIT in response to comment
If you want a progressbar in the top panel, just use:
您需要它们是 DockPanel,还是这是固定布局?
如果它已修复,您可以执行以下操作:
我使三个面板之间的区域随着窗口大小的调整而调整大小。
除了我使用的列表视图之外,您还可以放置几乎任何内容,用户控件、另一个网格等等。
颜色将向您轻松显示列表视图部分的位置。
您可能想要调整大小,或更改调整大小行为。
您可以在此处了解有关网格的更多信息
Do you need them to be DockPanels, or this is a fixed layout?
If it's fixed you could do something like this:
I made the area between your three panels re-sizable as your window resizes.
Instead of the listviews that I used, you can put pretty much anything, a user control, another grid, whatever.
The colors will show you where the listview sections are easily.
You will probably want to adjust the sizes, or change the resize behavior.
You can learn more about grids here
看起来这就是对齐、边距和填充的场景为处理...
Seems like this is the sort of scenario Alignment, Margins, and Padding are made to handle...