【问题标题】:XNA - Losing application-icon when returning from full screenXNA - 从全屏返回时丢失应用程序图标
【发布时间】:2013-06-07 10:22:51
【问题描述】:

我已经实现了以下(如here 所述)以返回窗口的 Aero 外观。尽管解决此问题需要 Windows 窗体程序集没有意义。 (因为它确实具有 Aero 外观。)

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

(实现System.Windows.Forms.Application.EnableVisualStyles(); 不起作用。提到here 。) 但是虽然我得到了 Aero 外观 - 我失去了应用程序图标。

全屏前:

全屏后:

如何找回图标?

(我使用的是 Windows 7 64 位。并在 Draw 方法中使用 graphics.ToggleFullScreen();。)

【问题讨论】:

  • 您是从 VS 运行/调试实例还是通过运行 exe 文件将其作为独立的实例启动?从 VS 调试时,您可能永远不会有图标
  • @DanielMesSer 来自 VS。是的,在发布之前,我检查并确实在全屏之前有一个图标。
  • @DanielMesSer 我现在也尝试过独立运行。结果相同。

标签: c# winforms xna xna-4.0


【解决方案1】:

解决了。

System.Windows.Forms.Form MyGameForm = (System.Windows.Forms.Form)System.Windows.Forms.Form.FromHandle(Window.Handle);
MyGameForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-29
    • 2014-09-30
    • 2012-05-03
    • 2015-08-20
    • 2014-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多