如何更改表格的图标和任务栏图标? [英] How to change Form's icon and tray icon?

查看:288
本文介绍了如何更改表格的图标和任务栏图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

有没有办法以编程方式更改GUI/表单图标和任务栏图标?
我使用Visual Studio 2013,并且想要更改此设置.但是我想使用嵌入式资源图标,我不喜欢将其与磁盘上文件的路径一起使用.

我拥有的实际代码如下

Hello guys,

is there a way to change the GUI / Form icon and tray icon programmatically?
I use Visual Studio 2013 and want to change this. But i want to use an embedded resource icon, i don''t like to use this with a path to the file on my disk.

My actual code I have is following

System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(frmMain::typeid));
this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"NosBackup.NBIcoData.Icon.IDI_ICON1.ico")));


但这并不会改变图标.

在此先感谢


But it doesn''t change the Icon.

Thanks in advance

推荐答案

尝试
将图标添加到系统托盘 [ http://www.gamedev.net/topic/601819-csetting-icon-for -an-exe/ [ ^ ]
Try
Adding Icons to the System Tray[^]
http://www.gamedev.net/topic/601819-csetting-icon-for-an-exe/[^]


这篇关于如何更改表格的图标和任务栏图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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