Friday, November 19, 2010

How to Embedd an image icon in vb.net application?

I want to add an image icon (like my computer on desktop) in vb.net application.How to do it?How to Embedd an image icon in vb.net application?
Add the icon file to your project.



Click on the file and change the ';Build Action'; to ';Embedded Resource';



Then in your code



Dim icoNormal as icon



icoNormal = New Icon(System.Reflection.Assembly.GetExecu鈥?br>




Changing %26lt;%26lt;ProjectName%26gt;%26gt; to your assembly name for your project

and %26lt;%26lt;IconFile%26gt;%26gt; to the name of the icon file.



Remember to keep the period (.) in between the two names.



eg



icoNormal = New Icon(System.Reflection.Assembly.GetExecu鈥?br>




If you don't know your assembly name they click on ';Project'; and ';Project Properties';How to Embedd an image icon in vb.net application?
As the icon for the program? As an .ico file the program is going to write to disk?

No comments:

Post a Comment