By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,571 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,571 IT Pros & Developers. It's quick & easy.

StatusBar Icon can't Switch

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.