问题
(I think Aero is the term).
When I start my XNA program in Windowed mode, I have the glossy bar as seen on Win7/Vista programs.
When I set to fullscreen and then revert, I will have a plain blue 'basic' title border.
How can I set the theme or style of this back to the Aero style?
回答1:
If you call the following before switching back to windowed mode, you will get the Aero style, but it requires you reference System.Windows.Forms.
System.Windows.Forms.Application.EnableVisualStyles();
I'm not certain if that's the best way to do it, but it works. I've used it in my XNA games.
As an example you can hang it off your Game class:
public class FooGame : Game
{
...
private void SetWindow(bool fullscreen)
{
if(!fullscreen)
{
System.Windows.Forms.Application.EnableVisualStyles();
}
this.graphicsDeviceManager.IsFullScreen = fullscreen;
this.graphicsDeviceManager.ApplyChanges();
}
}
Good luck.
回答2:
This will help:
System.Windows.Forms.Application.VisualStyleState = System.Windows.Forms.VisualStyles.VisualStyleState.ClientAndNonClientAreasEnabled;
来源:https://stackoverflow.com/questions/6885363/xna-losing-title-bar-theme-on-fullscreen-windowed-transition