Change Application Icon [ Output file icon]

G

Guest

Hi,

I have created an form based application in c# having some GUI. I have also
added localization support to it due to GUI changes for different
customers.Now the issue I have the Application icon can be set only through
Property page in common properties as is the Output file name. But i need
different icons (output file) for different customers and I have same code
base for all. As far as form icons are concerened they are obtained from
respective resource files. How can I chanage the Application icon on the
basis of Build settings. Is it possible?

Thx.
Avnish.
 
N

Nicholas Paldino [.NET/C# MVP]

Avnish,

You will only be able to do this in .NET 2.0 and up. Take a look at the
..csproj file for the executable. In it, you will see a tag:

<ApplicationIcon>?</ApplicationIcon>

Where ? is the name of the icon.

What you want to do is create a conditional value there based on other
conditions (you have to set these, obviously) to set the value to the
correct icon.

Take a look at the MSBUILD documentation to see how to do this.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top