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 6 1424
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
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
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
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
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
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 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
|
1 post
views
Thread by Thief_ |
last post: by
|
reply
views
Thread by S Wheeler |
last post: by
|
2 posts
views
Thread by reidarT |
last post: by
| | | | | | | | | | |