Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
C++
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
Posted
Updated 14-Sep-14 16:50pm
v4

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900