1

在 Windows 窗体上,您具有StartPosition允许您指定窗体在启动时放置在屏幕上的位置的属性。

WPF 是否有等价物,如果有,它是什么?

谢谢

4

1 回答 1

4

我想你正在寻找WindowsStartupLocation

将 WindowStartupLocation 设置为 Manual 会导致根据其 Left 和 Top 属性值定位窗口。如果未指定 Left 或 Top 属性,则它们的值由 Windows 确定。

<Window x:Class="WpfAppl.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="WindowName" 
    Height="500" Width="500"
    WindowStartupLocation="Manual" 
    Left="0" Top="0">
</Window>
于 2012-07-13T14:16:28.283 回答