ioustinos_sarris
asked on
draw an icon on the form from resources
Hi there, i am trying to retrieve an icon from my resources in order to draw it via GDI...
SO here is what i do and i keep getting null
my resource's name is tram and the icon is tram.ico
SO here is what i do and i keep getting null
my resource's name is tram and the icon is tram.ico
Dim list = System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceNames()
Dim assembly As System.Reflection.Assembly =Me.GetType().Assembly
Me.theIcon = GetEmbeddedIcon(assembly.GetName().Name & ".tram.ico")
Form1.gMyGraphics.DrawIcon(theIcon, 20, 20)
Function GetListOfEmbeddedResources() As Array
Return _
System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceNames
End Function
Function GetEmbeddedIcon(ByVal strName As String) As Icon
Return New Icon(System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream(strName))
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Make sure that you right clicked on the resource in the solution explorer and have set the "Build Action" property to "Embedded Resource"
Open in new window