【问题标题】:What is the WPF equivalent of Windows Forms' `StartPosition` property?Windows 窗体的“StartPosition”属性的 WPF 等效项是什么?
【发布时间】:2012-07-13 14:12:23
【问题描述】:

在 Windows 窗体上,您有 StartPosition 属性,可让您指定窗体启动时在屏幕上的位置。

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

谢谢

【问题讨论】:

标签: wpf


【解决方案1】:

我想你在找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>

【讨论】:

    猜你喜欢
    • 2010-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-03
    • 2012-10-16
    • 1970-01-01
    • 2010-11-19
    • 1970-01-01
    相关资源
    最近更新 更多