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.
我在画布内有 4 个 StackPanel。现在,我想动态地上下排列它的位置。我在谷歌上找到了很多信息,但我们不知道如何做到这一点。
您可以通过SetLeft和SetTop 方法设置Left和附加属性:Top
Left
Top
Canvas.SetLeft(stackPanel, 100); Canvas.SetTop(stackPanel, 50);