| re: VB.Net - Setting all form icons to the application icon
Just in case this might help you managing icons...
Add some icons to your project, make them embedded resources, then put their
file names in the enum below. Then you can access them easily like so:
Dim i As Icon = Resources.GetIcon(Icons.IconName1)
Watch for line breaks...
------BEGIN CODE-------
Imports System.Reflection
Public Class Resources
Private Sub New()
End Sub
Public Enum Icons
IconName1
IconName2
IconName3
End Enum
Private Shared RootNameSpace As String = GetType(Resources).Namespace
Public Shared Function GetIcon(ByVal Icon As Icons) As Icon
Dim ret As Icon
Dim asm As [Assembly] = [Assembly].GetExecutingAssembly
Dim Name As String = _
RootNameSpace & "." & System.Enum.GetName(Icon.GetType, Icon) &
".ico"
Dim s As System.IO.Stream = asm.GetManifestResourceStream(Name)
If Not s Is Nothing Then
ret = New Icon(s)
s.Close()
End If
Return ret
End Function
End Class
------END CODE-------
"QLD_AU" <News@DigitalSniper.Net> wrote in message
news:42047e22$1@duster.adelaide.on.net...[color=blue]
> Is their a way in a VB.Net application to set all sub form icons to the[/color]
main[color=blue]
> form ? or even set all icons to the Application icon, without having to
> reference the icon as a filename ?
>
> With Thanks
>
> Jason
>
>[/color] |