I am new to WPF and having problems getting my GUI to display correctly. I have a Grid that has a toolbox and a UniformGrid in it. The UniformGrid has a bunch of buttons in it and there is a text box in the toolbox. My problem is unless the application window is full screen the buttons are on top of the Grid. How do I fix this, so that the buttons are bellow the grid.
我是WPF的新手,在让我的GUI正确显示方面遇到了问题。我有一个Grid,里面有一个工具箱和一个UniformGrid。 UniformGrid中有一堆按钮,工具箱中有一个文本框。我的问题是除非应用程序窗口全屏,按钮位于网格顶部。我如何解决这个问题,以便按钮位于网格下方。
1 个解决方案
#1
0
use a StackPanel
with Orientation = Vetrical
or a DockPanel
toolbox.Dock = Top
使用具有Orientation = Vetrical或DockPanel工具箱的StackPanel.Dock = Top
<StackPanel Orientation="Vertical">
<Toolbox>
<TextBox></TextBox>
</Toolbox>
<UniformGrid>
<Button></Button>
<Button></Button>
</UniformGrid>
</StackPanel>
#1
0
use a StackPanel
with Orientation = Vetrical
or a DockPanel
toolbox.Dock = Top
使用具有Orientation = Vetrical或DockPanel工具箱的StackPanel.Dock = Top
<StackPanel Orientation="Vertical">
<Toolbox>
<TextBox></TextBox>
</Toolbox>
<UniformGrid>
<Button></Button>
<Button></Button>
</UniformGrid>
</StackPanel>