467,182 Members | 1,051 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,182 developers. It's quick & easy.

StatusBar Icon can't Switch

Hi All,

I have two icons:
Private micoIcon1 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon1.ico"))
Private micoIcon2 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon2.ico"))

I want switch them:
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon = micoIcon1
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub

This works in case of SysTray icon, but not for StatusBar Panel (always
remain micoIcon1). I think I missed something to use the StatusBar Panel.
Can someone tell what's wrong or missed?
Thanks for any tips,
Anony
Nov 20 '05 #1
  • viewed: 1241
Share:
6 Replies
Hi,

Use Equals instead of is.
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon.Equals( micoIcon1) then
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub
Ken
-----------------------
"Anony" <an***@nepal.nl> wrote in message
news:ce**********@news5.tilbu1.nb.home.nl...
Hi All,

I have two icons:
Private micoIcon1 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon1.ico"))
Private micoIcon2 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon2.ico"))

I want switch them:
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon = micoIcon1
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub

This works in case of SysTray icon, but not for StatusBar Panel (always
remain micoIcon1). I think I missed something to use the StatusBar Panel.
Can someone tell what's wrong or missed?
Thanks for any tips,
Anony

Nov 20 '05 #2
Hi,

Use Equals instead of is.
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon.Equals( micoIcon1) then
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub
Ken
-----------------------
"Anony" <an***@nepal.nl> wrote in message
news:ce**********@news5.tilbu1.nb.home.nl...
Hi All,

I have two icons:
Private micoIcon1 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon1.ico"))
Private micoIcon2 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon2.ico"))

I want switch them:
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon = micoIcon1
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub

This works in case of SysTray icon, but not for StatusBar Panel (always
remain micoIcon1). I think I missed something to use the StatusBar Panel.
Can someone tell what's wrong or missed?
Thanks for any tips,
Anony

Nov 20 '05 #3
Thanks Ken,

I tried Equals instead of Is, but nothing changed.
The .Icon.Equals( micoIcon1) seems always return False
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uw*************@TK2MSFTNGP10.phx.gbl...
Hi,

Use Equals instead of is.
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon.Equals( micoIcon1) then
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub
Ken
-----------------------
"Anony" <an***@nepal.nl> wrote in message
news:ce**********@news5.tilbu1.nb.home.nl...
Hi All,

I have two icons:
Private micoIcon1 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon1.ico"))
Private micoIcon2 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon2.ico"))

I want switch them:
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon = micoIcon1
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub

This works in case of SysTray icon, but not for StatusBar Panel (always
remain micoIcon1). I think I missed something to use the StatusBar Panel.
Can someone tell what's wrong or missed?
Thanks for any tips,
Anony

Nov 20 '05 #4
Thanks Ken,

I tried Equals instead of Is, but nothing changed.
The .Icon.Equals( micoIcon1) seems always return False

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uw*************@TK2MSFTNGP10.phx.gbl...
Hi,

Use Equals instead of is.
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon.Equals( micoIcon1) then
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub
Ken
-----------------------
"Anony" <an***@nepal.nl> wrote in message
news:ce**********@news5.tilbu1.nb.home.nl...
Hi All,

I have two icons:
Private micoIcon1 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon1.ico"))
Private micoIcon2 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon2.ico"))

I want switch them:
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon = micoIcon1
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub

This works in case of SysTray icon, but not for StatusBar Panel (always
remain micoIcon1). I think I missed something to use the StatusBar Panel.
Can someone tell what's wrong or missed?
Thanks for any tips,
Anony

Nov 20 '05 #5
Thanks Ken,

I tried Equals instead of Is, but nothing changed.
The .Icon.Equals( micoIcon1) seems always return False
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uw*************@TK2MSFTNGP10.phx.gbl...
Hi,

Use Equals instead of is.
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon.Equals( micoIcon1) then
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub
Ken
-----------------------
"Anony" <an***@nepal.nl> wrote in message
news:ce**********@news5.tilbu1.nb.home.nl...
Hi All,

I have two icons:
Private micoIcon1 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon1.ico"))
Private micoIcon2 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon2.ico"))

I want switch them:
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon = micoIcon1
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub

This works in case of SysTray icon, but not for StatusBar Panel (always
remain micoIcon1). I think I missed something to use the StatusBar Panel.
Can someone tell what's wrong or missed?
Thanks for any tips,
Anony

Nov 20 '05 #6
Thanks Ken,

I tried Equals instead of Is, but nothing changed.
The .Icon.Equals( micoIcon1) seems always return False

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uw*************@TK2MSFTNGP10.phx.gbl...
Hi,

Use Equals instead of is.
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon.Equals( micoIcon1) then
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub
Ken
-----------------------
"Anony" <an***@nepal.nl> wrote in message
news:ce**********@news5.tilbu1.nb.home.nl...
Hi All,

I have two icons:
Private micoIcon1 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon1.ico"))
Private micoIcon2 As New
System.Drawing.Icon(System.IO.Path.Combine(Applica tion.StartupPath,
"Icon2.ico"))

I want switch them:
Private Sub SwitchIcons()
With sbpIcon 'this is the StatusBar Panel name
If .Icon = micoIcon1
.Icon = micoIcon2
Else
.Icon = micoIcon1
End If
End With
End Sub

This works in case of SysTray icon, but not for StatusBar Panel (always
remain micoIcon1). I think I missed something to use the StatusBar Panel.
Can someone tell what's wrong or missed?
Thanks for any tips,
Anony

Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Tonya | last post: by
1 post views Thread by Ahmet | last post: by
3 posts views Thread by EricJ | last post: by
7 posts views Thread by Geoff | last post: by
reply views Thread by Anony | last post: by
14 posts views Thread by Kishan Hathiwala | last post: by
reply views Thread by S Wheeler | last post: by
2 posts views Thread by reidarT | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.