UrbanPuppet
asked on
Icons already in the EXE
In the project properties, I set my application's default icon which, in turn, added it to the resources or whatever you want to call it.. it's compiled in with the exe.. I plan on doing this with all my icons but I need to know how to get the icons in the form of System.Drawing.Icon so they can be accepted in most controls. Thanks in advance.
ASKER
Stream isn't a type, so that code isn't working; how would I get it to work?
actually Stream is a type http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemiostreamclasstopic.asp
are you importing System.IO ?
what about System.Reflection for the assembly class ?
what about System.Reflection for the assembly class ?
ASKER
Ok, sorry, did that and now it's almost working, I just don't know what to put for namespace.objectname .. the project is called XSM and the icon is called icoMain.ico but XSM.icoMain.ico didn't work. I've raised the points a little too.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK, thanks, that link helped a lot.. But i had after I tinkered with your first post.. I just needed to change the icon to an embedded resource..
The final code ended up like this:
Dim Stream As System.IO.Stream = System.Reflection.Assembly .GetExecut ingAssembl y().GetMan ifestResou rceStream( "XSM.icoMa in.ico")
Dim i As Icon = New Icon(Stream)
frmMain.Icon = i
The final code ended up like this:
Dim Stream As System.IO.Stream = System.Reflection.Assembly
Dim i As Icon = New Icon(Stream)
frmMain.Icon = i
you could just use
imports System.IO
imports System.Reflection
glad you could get it working ...
Cheers,
Greg
imports System.IO
imports System.Reflection
glad you could get it working ...
Cheers,
Greg
dim i as Icon = new Icon(stream);