Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在 WPF 中构建一个用户控件,并将几个按钮放在位于网格内的堆栈面板中。问题是,当我构建应用程序并运行它时,按钮“四处游荡”并且不会停留在我将它们放在设计器窗口中的位置。我是否缺少任何属性(或某种容器?)?
谢谢。
尝试设置网格的对齐属性:
<Grid HorizontalAlignment="Left" VerticalAlignment="Top"> ... </Grid>