【发布时间】:2014-04-09 14:52:38
【问题描述】:
我在 Windows 7 64 位 .NET 4.5.1
下有一个 2 显示器系统这里是重现我遇到的令人讨厌的情况的窗口和步骤:
窗口的xaml
<Window x:Class="WindowStyleTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WindowStyle Test"
WindowStartupLocation="CenterOwner"
WindowStyle="None"
Height="350"
Width="525"
Loaded="MainWindow_OnLoaded">
<Grid>
</Grid>
</Window>
窗口后面的代码
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
{
// quick fix to show the taskbar, you can remove this, but it also doesn't work
this.WindowStyle = System.Windows.WindowStyle.ThreeDBorderWindow;
this.WindowState = System.Windows.WindowState.Maximized;
this.WindowStyle = System.Windows.WindowStyle.None;
}
}
- 使用
SHIFT+WIN+LEFT或SHIFT+WIN+RIGHT将最大化 窗口移动到其他显示器 - 现在窗口应该被移动到另一个监视器并且仍然最大化
- 尝试使用
SHIFT+WIN+LEFT或SHIFT+WIN+RIGHT将窗口移回上一个/第一个监视器 - 所以你想知道为什么什么都没发生吗? 窗口不再移动!
- 我也是:-D
- 测试系统:Windows 7 64 bit .NET 4.5.1
有解决这个问题的想法吗?我认为这是一个 Windows 问题。
是的,我需要WindowStyle="None"
【问题讨论】:
-
窗口不再移动!
-
冷静点,你没有具体说明你的问题。您只是粘贴了一堆重现步骤和代码,而没有指出问题所在。不要指望每个人都阅读并完成您的步骤来为您测试它。你是在请大家帮个忙。
-
我在没有您的代码隐藏的情况下尝试了您的
XAML。它对我有用吗? -
我只有一个显示器,所以我无法重现这个来解决您遇到的问题。那你的问题是什么?
标签: c# .net wpf windows winapi