The way I did it was as follows...
Have an array of icons:
Dim Icons(2) As System.Drawing.Icon
Have your icons set as embedded (so they go into the resource file). Select
the icon in solution explore and change the build action to embedded.
Dim p As System.Reflection.Assembly
p = System.Reflection.Assembly.GetExecutingAssembly()
Icons(0) = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),
"GreenBulb.ico"))
Icons(2) = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),
"RedBulb.ico"))
Icons(1) = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),
"YellowBulb.ico"))
Then change the icon as you need it.
ntfSystemInfo.Icon = Icons(Counter)
I hope this helps
Chris
"Amjad" <Am***@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
Hi,
I'm using the NotifyIcon to process some text files in the background
periodically. I want to display one icon in the task bar when the program
is
in stand by mode, and I want to display another icon when it is in
processing
mode. How can I do that? I have some pseudo code below:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Try
If processing Then
NotifyIcon.Text = "Processing .."
NotifyIcon.Icon = New Icon("Busy.ico") 'the problem is
here,
I added the icon file to the solution explorer, but it's not using it!
Else
NotifyIcon.Text = "Standing By"
NotifyIcon.Icon = New Icon("Normal.ico")
End If
Catch ex As Exception
End Try
End Sub