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

changing icon in statusbar

P: n/a
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline,
its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its online -
by default using windows property) now i want to change its icon in runtime.
can i see how it can be changed?

and in the 2nd panel
thanks

K.
Nov 21 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
"Kishan Hathiwala" <ki****@hathiwala.fateback.com> schrieb:
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline,
its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its
online -
by default using windows property) now i want to change its icon in
runtime.


<URL:http://www.google.de/groups?selm=OIoCi89qEHA.3988%40tk2msftngp13.phx.gb l>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #2

P: n/a
"Kishan Hathiwala" <ki****@hathiwala.fateback.com> schrieb:
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline,
its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its
online -
by default using windows property) now i want to change its icon in
runtime.


<URL:http://www.google.de/groups?selm=OIoCi89qEHA.3988%40tk2msftngp13.phx.gb l>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #3

P: n/a
Hi Kishan

The key is in the event object on the Status Bar Panel click event handler.

This code swaps the form's icon and the status bar icon when you click on it:

HTH

Nigel

Private Sub StatusBar1_PanelClick(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles
StatusBar1.PanelClick
Dim i As Icon = e.StatusBarPanel.Icon
e.StatusBarPanel.Icon = Me.Icon
Me.Icon = i
End Sub

"Kishan Hathiwala" wrote:
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline,
its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its online -
by default using windows property) now i want to change its icon in runtime.
can i see how it can be changed?

and in the 2nd panel
thanks

K.

Nov 21 '05 #4

P: n/a
Hi Kishan

The key is in the event object on the Status Bar Panel click event handler.

This code swaps the form's icon and the status bar icon when you click on it:

HTH

Nigel

Private Sub StatusBar1_PanelClick(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles
StatusBar1.PanelClick
Dim i As Icon = e.StatusBarPanel.Icon
e.StatusBarPanel.Icon = Me.Icon
Me.Icon = i
End Sub

"Kishan Hathiwala" wrote:
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline,
its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its online -
by default using windows property) now i want to change its icon in runtime.
can i see how it can be changed?

and in the 2nd panel
thanks

K.

Nov 21 '05 #5

P: n/a
Greets

the link you provided is not working

K
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O9**************@tk2msftngp13.phx.gbl...
"Kishan Hathiwala" <ki****@hathiwala.fateback.com> schrieb:
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline, its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its
online -
by default using windows property) now i want to change its icon in
runtime.

<URL:http://www.google.de/groups?selm=OIo...ftngp13.phx.gb
l>
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #6

P: n/a
Greets

the link you provided is not working

K
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O9**************@tk2msftngp13.phx.gbl...
"Kishan Hathiwala" <ki****@hathiwala.fateback.com> schrieb:
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline, its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its
online -
by default using windows property) now i want to change its icon in
runtime.

<URL:http://www.google.de/groups?selm=OIo...ftngp13.phx.gb
l>
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #7

P: n/a
the thing is the icon is not of form's icon. its outsided icon

"Nigel Armstrong" <Ni************@discussions.microsoft.com> wrote in
message news:60**********************************@microsof t.com...
Hi Kishan

The key is in the event object on the Status Bar Panel click event handler.
This code swaps the form's icon and the status bar icon when you click on it:
HTH

Nigel

Private Sub StatusBar1_PanelClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles
StatusBar1.PanelClick
Dim i As Icon = e.StatusBarPanel.Icon
e.StatusBarPanel.Icon = Me.Icon
Me.Icon = i
End Sub

"Kishan Hathiwala" wrote:
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline, its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its online - by default using windows property) now i want to change its icon in runtime. can i see how it can be changed?

and in the 2nd panel
thanks

K.

Nov 21 '05 #8

P: n/a
the thing is the icon is not of form's icon. its outsided icon

"Nigel Armstrong" <Ni************@discussions.microsoft.com> wrote in
message news:60**********************************@microsof t.com...
Hi Kishan

The key is in the event object on the Status Bar Panel click event handler.
This code swaps the form's icon and the status bar icon when you click on it:
HTH

Nigel

Private Sub StatusBar1_PanelClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles
StatusBar1.PanelClick
Dim i As Icon = e.StatusBarPanel.Icon
e.StatusBarPanel.Icon = Me.Icon
Me.Icon = i
End Sub

"Kishan Hathiwala" wrote:
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline, its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its online - by default using windows property) now i want to change its icon in runtime. can i see how it can be changed?

and in the 2nd panel
thanks

K.

Nov 21 '05 #9

P: n/a
"Kishan Hathiwala" <ki****@hathiwala.fateback.com> schrieb:
the link you provided is not working


Maybe you'll have to remove the '<URL:'...'>' markup in order to make it
work...

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #10

P: n/a
"Kishan Hathiwala" <ki****@hathiwala.fateback.com> schrieb:
the link you provided is not working


Maybe you'll have to remove the '<URL:'...'>' markup in order to make it
work...

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #11

P: n/a
Kishan,
the thing is the icon is not of form's icon. its outsided icon
I realise that...I thought you might be able to look at the constructor for
the Icon class to do the rest. For example, if you want to load from an Icon
file C:\test.ico, then you would create your icon as:

Dim i1 As New Icon("C:\test.ico")

There are other options as well, such as from resource files etc...

HTH

Nigel Armstrong

"Kishan Hathiwala" wrote:
the thing is the icon is not of form's icon. its outsided icon

"Nigel Armstrong" <Ni************@discussions.microsoft.com> wrote in
message news:60**********************************@microsof t.com...
Hi Kishan

The key is in the event object on the Status Bar Panel click event

handler.

This code swaps the form's icon and the status bar icon when you click on

it:

HTH

Nigel

Private Sub StatusBar1_PanelClick(ByVal sender As System.Object, ByVal

e
As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles
StatusBar1.PanelClick
Dim i As Icon = e.StatusBarPanel.Icon
e.StatusBarPanel.Icon = Me.Icon
Me.Icon = i
End Sub

"Kishan Hathiwala" wrote:
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline, its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its online - by default using windows property) now i want to change its icon in runtime. can i see how it can be changed?

and in the 2nd panel
thanks

K.


Nov 21 '05 #12

P: n/a
Kishan,
the thing is the icon is not of form's icon. its outsided icon
I realise that...I thought you might be able to look at the constructor for
the Icon class to do the rest. For example, if you want to load from an Icon
file C:\test.ico, then you would create your icon as:

Dim i1 As New Icon("C:\test.ico")

There are other options as well, such as from resource files etc...

HTH

Nigel Armstrong

"Kishan Hathiwala" wrote:
the thing is the icon is not of form's icon. its outsided icon

"Nigel Armstrong" <Ni************@discussions.microsoft.com> wrote in
message news:60**********************************@microsof t.com...
Hi Kishan

The key is in the event object on the Status Bar Panel click event

handler.

This code swaps the form's icon and the status bar icon when you click on

it:

HTH

Nigel

Private Sub StatusBar1_PanelClick(ByVal sender As System.Object, ByVal

e
As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles
StatusBar1.PanelClick
Dim i As Icon = e.StatusBarPanel.Icon
e.StatusBarPanel.Icon = Me.Icon
Me.Icon = i
End Sub

"Kishan Hathiwala" wrote:
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. once i clic on online its icon
changes to connecticon (assume its there) and whenever i click on offline, its icon changes to disconnection (assume this is also there).

now the problem is i have kept one icon for connection (ie when its online - by default using windows property) now i want to change its icon in runtime. can i see how it can be changed?

and in the 2nd panel
thanks

K.


Nov 21 '05 #13

P: n/a
can you just provide me sample code, if possible

"Nigel Armstrong" <Ni************@discussions.microsoft.com> wrote in
message news:DE**********************************@microsof t.com...
Kishan,
the thing is the icon is not of form's icon. its outsided icon
I realise that...I thought you might be able to look at the constructor

for the Icon class to do the rest. For example, if you want to load from an Icon file C:\test.ico, then you would create your icon as:

Dim i1 As New Icon("C:\test.ico")

There are other options as well, such as from resource files etc...

HTH

Nigel Armstrong

"Kishan Hathiwala" wrote:
the thing is the icon is not of form's icon. its outsided icon

"Nigel Armstrong" <Ni************@discussions.microsoft.com> wrote in
message news:60**********************************@microsof t.com...
Hi Kishan

The key is in the event object on the Status Bar Panel click event

handler.

This code swaps the form's icon and the status bar icon when you click on
it:

HTH

Nigel

Private Sub StatusBar1_PanelClick(ByVal sender As System.Object,
ByVal e
As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles
StatusBar1.PanelClick
Dim i As Icon = e.StatusBarPanel.Icon
e.StatusBarPanel.Icon = Me.Icon
Me.Icon = i
End Sub

"Kishan Hathiwala" wrote:

> 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. once i clic on online its

icon > changes to connecticon (assume its there) and whenever i click on

offline,
> its icon changes to disconnection (assume this is also there).
>
> now the problem is i have kept one icon for connection (ie when its

online -
> by default using windows property) now i want to change its icon in

runtime.
> can i see how it can be changed?
>
> and in the 2nd panel
> thanks
>
> K.
>
>
>


Nov 21 '05 #14

P: n/a
can you just provide me sample code, if possible

"Nigel Armstrong" <Ni************@discussions.microsoft.com> wrote in
message news:DE**********************************@microsof t.com...
Kishan,
the thing is the icon is not of form's icon. its outsided icon
I realise that...I thought you might be able to look at the constructor

for the Icon class to do the rest. For example, if you want to load from an Icon file C:\test.ico, then you would create your icon as:

Dim i1 As New Icon("C:\test.ico")

There are other options as well, such as from resource files etc...

HTH

Nigel Armstrong

"Kishan Hathiwala" wrote:
the thing is the icon is not of form's icon. its outsided icon

"Nigel Armstrong" <Ni************@discussions.microsoft.com> wrote in
message news:60**********************************@microsof t.com...
Hi Kishan

The key is in the event object on the Status Bar Panel click event

handler.

This code swaps the form's icon and the status bar icon when you click on
it:

HTH

Nigel

Private Sub StatusBar1_PanelClick(ByVal sender As System.Object,
ByVal e
As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles
StatusBar1.PanelClick
Dim i As Icon = e.StatusBarPanel.Icon
e.StatusBarPanel.Icon = Me.Icon
Me.Icon = i
End Sub

"Kishan Hathiwala" wrote:

> 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. once i clic on online its

icon > changes to connecticon (assume its there) and whenever i click on

offline,
> its icon changes to disconnection (assume this is also there).
>
> now the problem is i have kept one icon for connection (ie when its

online -
> by default using windows property) now i want to change its icon in

runtime.
> can i see how it can be changed?
>
> and in the 2nd panel
> thanks
>
> K.
>
>
>


Nov 21 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.