473,382 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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
6 1491
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tonya | last post by:
Hi, Does anyone know how i can add controls to a progress bar. I have searched the internet but could not find any examples. what i want to add is a progress bar and a button. thx
1
by: Ahmet | last post by:
In my application, I have statusbar on which i show icons. On some cases, I have to change icon of my statusbar to show different messages on panels. But I dont know how to change icon of one...
3
by: EricJ | last post by:
Hi I'm having trouble getting icons from an imagelist in a statusbar panel. if i load the icons directly it works Dim ico As new Icon("W95MBX03.ICO") statusbarPanel..Icon = ico but if i try...
7
by: Geoff | last post by:
I would like to have a status bar which has a few panels, one of which I want to display a different .gif under different conditions. I have added the status bar to the form, I have added the...
0
by: Anony | last post by:
Hi All, I have two icons: Private micoIcon1 As New System.Drawing.Icon(System.IO.Path.Combine(Application.StartupPath, "Icon1.ico")) Private micoIcon2 As New...
14
by: Kishan Hathiwala | last post by:
Hi i have kept a statusbar in the form with panels = true. and total there 3 panels. whenever i click on the 3rd panel a menu appears showing online and offline and either is enable at a time....
1
by: Thief_ | last post by:
In VB6, I can use: StatusBar1.Panels(1).Picture = ImageList1.ListImages(1).Picture I can't figger out how to do it in VB.Net 2003. I tried converting the project to .Net and got: ...
0
by: S Wheeler | last post by:
I have a winform app written in managed vc++. The app has a status bar with a couple of icons that need to be changed at runtime; also, I want to embed a progress bar in one of the panes. The icons...
2
by: reidarT | last post by:
Is it possible to show icon on statusbar, when my application is opened. (Not on taskbar, but on the right side of the 'bottombar') reidarT
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.