C# XNA全屏丢失标题栏主题->;窗口过渡

C# XNA全屏丢失标题栏主题->;窗口过渡,c#,xna,fullscreen,aero,windowed,C#,Xna,Fullscreen,Aero,Windowed,(我认为Aero是一个术语) 当我在窗口模式下启动XNA程序时,我会看到Win7/Vista程序上的光面条 当我设置为全屏,然后恢复时,我将有一个纯蓝色的“基本”标题边框 如何将此主题或样式设置回Aero样式?如果在切换回窗口模式之前调用以下命令,您将获得Aero样式,但它要求您引用System.Windows.Forms System.Windows.Forms.Application.EnableVisualStyles(); 我不确定这是否是最好的方法,但它是有效的。我在我的XNA游戏中

(我认为Aero是一个术语)

当我在窗口模式下启动XNA程序时,我会看到Win7/Vista程序上的光面条

当我设置为全屏,然后恢复时,我将有一个纯蓝色的“基本”标题边框


如何将此主题或样式设置回Aero样式?

如果在切换回窗口模式之前调用以下命令,您将获得Aero样式,但它要求您引用System.Windows.Forms

System.Windows.Forms.Application.EnableVisualStyles();
我不确定这是否是最好的方法,但它是有效的。我在我的XNA游戏中使用过它

例如,您可以将其挂在游戏类上:

public class FooGame : Game
{
    ... 

    private void SetWindow(bool fullscreen)
    {
        if(!fullscreen)
        {
            System.Windows.Forms.Application.EnableVisualStyles();
        }

        this.graphicsDeviceManager.IsFullScreen = fullscreen;
        this.graphicsDeviceManager.ApplyChanges();
    }
}
祝你好运。

这将有助于:

System.Windows.Forms.Application.VisualStyleState=System.Windows.Forms.VisualStyles.VisualStyleState.ClientAndNonClientAreasEnabled


很遗憾,没有非Windows的方式来做这件事……但是,嘿,这是XNA。