如何分配应用程序图标将在任务栏中显示? [英] How to assign Application Icon that will display in Task bar?

查看:411
本文介绍了如何分配应用程序图标将在任务栏中显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个WPF桌面应用程序,每当我跑我的应用程序它显示我在任务栏窗口和相关选项卡(普通窗功能)。我的问题是使用窗口的未知文件类型图标的选项卡,我试着用窗口的图标属性图标被分配但仍然问题是,当我运行的应用程序,任务栏选项卡最初显示窗口的未知文件类型,当图标窗口加载完成它改变分配的图标。我想从一开始图标那里。 ?任何帮助。

I am working on a Wpf desktop application, whenever i run my application it shows me a window and associated tab in the task bar(Normal windows feature). My problem is that the tab is using window's icon for unknown file-type, I tried with Icon property of Window, Icon gets assigned but still problem is when I run application, task bar Tab initially displays window's icon for unknown file-type and when window-load completes it changes to the Icon assigned. I want Icon there from beginning. Any help?

我试着用的.csproj - >属性 - >应用程序选项卡 - - >图标
并将其设置为一个.ico文件。它的工作原理,但我需要.exe文件来运行我的应用程序。 (通过Visual Studio运行时),它不会在开发环境中工作。我需要设置启动项目选项即可。是否有任何其他方式来解决这个问题?

I tried with .csproj --> Properties --> Application Tab --> Icon and set it to a .ico file. It works but I need to run my application by .exe file. It doesn't work in development environment(while running through visual studio). I need to set Start-Project option then. Is there any other way to solve this problem?

推荐答案

检查你的主窗口项目的属性。您应该能够设置一个图标在那里。

Check the properties of your main Window project.. You should be able to set an icon there.

更新:
是它,这样你的图标不显示的问题调试模式?只要当你交付方案给客户的作品,它的一切还好,不是

Update: Is it such a problem that your icon does not show in debug mode? As long as it works when you deliver the program to your customer, its all alright, not?

在一个侧面说明:你可以检查一些事情虽然。也许是不包含在您的项目中的图标,或者建立你的调试文件夹时,它不是复制?

On a side note: You could check some things though. Perhaps your icon is not included in your project, or it isnt copied when building to your Debug folder?

更新2:
你还需要设置主窗体的图标为它在调试显示。如果你还设置了图标的主要形式,它会显示在调试/运行期间的任务栏。

Update 2: You also need to set the Main Form's Icon for it to show in Debug. If you also set the icon for the main form, it will display in the Taskbar during Debug / Runtime.

这篇关于如何分配应用程序图标将在任务栏中显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆