473,410 Members | 1,937 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,410 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 1494
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.