【问题标题】:Customer application icon is not showing in taskbar - why?客户应用程序图标未显示在任务栏中 - 为什么?
【发布时间】:2014-02-09 08:54:47
【问题描述】:

情况:用VS 2012实现一个WPF应用程序,并在主窗口添加了一个自定义图标,标签为Icon="images\myIcon.gif">。

当使用CTRL + F5 从 VS 2012 启动 WPF 应用程序时,图标将显示在任务栏和主窗口的左上角。

问题:我使用 VS 2012 的发布向导(一键安装例程)发布了我的应用程序,并在我的计算机上安装了该应用程序。启动已安装的应用程序时,左上角的图标仍显示在主窗口中,但任务栏图标不显示。而是显示一个 Windows 默认图标。

问题:有人知道问题是什么或我错过了什么吗?

【问题讨论】:

  • 尝试使用以下路径:Icon="/ApplicationName;component/images/myIcon.gif">。

标签: c# wpf icons


【解决方案1】:

来自MSDN:

Windows Presentation Foundation (WPF) 独立应用程序有两个 图标类型:

One assembly icon, which is specified by using the <ApplicationIcon> property
in the application's project build file. This icon is used as the desktop
icon for an assembly.

One icon per window that is specified by setting Icon. For each window,
this icon is used in its title bar, its task bar button, and
in its ALT-TAB application selection list entry.

如果要在任务栏中显示图标,则需要设置程序集/应用程序图标:

  • 打开由 ClickOnce 部署的项目的属性
  • 应用程序 --> 资源
  • 选择图标和清单并浏览您想要的图标

【讨论】:

  • 完美,你让我开心:-)
  • 仍然没有显示:我在启动期间更改了 MainWindow(启动画面)。有什么想法吗?
猜你喜欢
  • 2016-11-17
  • 2011-03-13
  • 2015-04-08
  • 1970-01-01
  • 2018-08-11
  • 2011-01-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多