468,161 Members | 1,952 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,161 developers. It's quick & easy.

Put a picture in a StatusBar Panel

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 panels to the status bar, and I
have used the Dim xxx As New Bitmap ("path.file.ext") to
create the bitmaps. I have a Select Case block to set
MyStatusPicture. I have included an "Imports
System.Drawing" stmt. But I can't seem to get the
StatusBarPanel to show the Bitmap. What am I missing?
How do I get the Status Bar to repaint that panel with the
selected bitmap?

TIA,
Geoff
Nov 20 '05 #1
7 1909
Cor
Hi Geoff,

In addition to Ken, when you first make from the bmp an icon, you can do
that with visual.studio.net, then you can do something as
\\
Me.stpLeft.Icon = busyIcon
//
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 panels to the status bar, and I
have used the Dim xxx As New Bitmap ("path.file.ext") to
create the bitmaps. I have a Select Case block to set
MyStatusPicture. I have included an "Imports
System.Drawing" stmt. But I can't seem to get the
StatusBarPanel to show the Bitmap. What am I missing?
How do I get the Status Bar to repaint that panel with the
selected bitmap?

Nov 20 '05 #2
* "Geoff" <ge***@tnhg.com> scripsit:
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 panels to the status bar, and I
have used the Dim xxx As New Bitmap ("path.file.ext") to
create the bitmaps. I have a Select Case block to set
MyStatusPicture. I have included an "Imports
System.Drawing" stmt. But I can't seem to get the
StatusBarPanel to show the Bitmap. What am I missing?
How do I get the Status Bar to repaint that panel with the
selected bitmap?


Add sone icon files to your project and set their 'Build Action' property to
'Embedded Resource'. You can use the code below to load the icon at runtime:

\\\
foo.Icon = _
New Icon( _
[Assembly].GetExecutingAssembly().GetManifestResourceStream( _
"WindowsApplication1.Ball.ico" _
) _
)
///

'WindowsApplication1' is the root namespace of the application, "Ball.ico" is
the icon's filename.

Just assign the icon to the StatusBarPanel's 'Icon' property.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Ken,
Yes, that panel is already set to "ownerdraw", but ...

How do I make get the "statusbar drawitem" event
to "trigger"? I would expect a "method" so that I
could "invoke" it.

(Forgot to mention - I am using VB7, not C#.)

How do I access the msg attachment that contains the
simple example?

Thanks for your help.
Geoff
-----Original Message-----
Hi,

You have to set the statusbarpanel style to ownerdraw. Add codeto the statusbar drawitem event. I attached a simple example.
Ken

--------------------

"Geoff" <ge***@tnhg.com> wrote in message
news:07****************************@phx.gbl...
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 panels to the status bar, and I
have used the Dim xxx As New Bitmap ("path.file.ext") to create the bitmaps. I have a Select Case block to set
MyStatusPicture. I have included an "Imports
System.Drawing" stmt. But I can't seem to get the
StatusBarPanel to show the Bitmap. What am I missing?
How do I get the Status Bar to repaint that panel with the selected bitmap?

TIA,
Geoff


Nov 20 '05 #4
Herfried,
I would like to use .gif's instead of .ico's, since they
are "animated" and are rectangular instead of square. Is
there a way to do this using .gif's?

Thanks again for your help,
Geoff
-----Original Message-----
* "Geoff" <ge***@tnhg.com> scripsit:
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 panels to the status bar, and I
have used the Dim xxx As New Bitmap ("path.file.ext") to create the bitmaps. I have a Select Case block to set
MyStatusPicture. I have included an "Imports
System.Drawing" stmt. But I can't seem to get the
StatusBarPanel to show the Bitmap. What am I missing? How do I get the Status Bar to repaint that panel with the selected bitmap?
Add sone icon files to your project and set their 'Build

Action' property to'Embedded Resource'. You can use the code below to load the icon at runtime:
\\\
foo.Icon = _
New Icon( _
[Assembly].GetExecutingAssembly ().GetManifestResourceStream( _ "WindowsApplication1.Ball.ico" _
) _
)
///

'WindowsApplication1' is the root namespace of the application, "Ball.ico" isthe icon's filename.

Just assign the icon to the StatusBarPanel's 'Icon' property.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #5
* <an*******@discussions.microsoft.com> scripsit:
I would like to use .gif's instead of .ico's, since they
are "animated" and are rectangular instead of square. Is
there a way to do this using .gif's?


You will have to go into "ownerdrawn" statusbar panels ('Style' =
'OwnerDraw').

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
Hi,

Here is a link to the sample.
http://www.onteorasoftware.com/Downl...tusbardraw.zip

To get the statusbar to redraw.
StatusBar1.Invalidate()

Ken
---------------------------
<an*******@discussions.microsoft.com> wrote in message
news:0a****************************@phx.gbl...
Ken,
Yes, that panel is already set to "ownerdraw", but ...

How do I make get the "statusbar drawitem" event
to "trigger"? I would expect a "method" so that I
could "invoke" it.

(Forgot to mention - I am using VB7, not C#.)

How do I access the msg attachment that contains the
simple example?

Thanks for your help.
Geoff
-----Original Message-----
Hi,

You have to set the statusbarpanel style to

ownerdraw. Add code
to the statusbar drawitem event. I attached a simple

example.

Ken

--------------------

"Geoff" <ge***@tnhg.com> wrote in message
news:07****************************@phx.gbl...
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 panels to the status bar, and I
have used the Dim xxx As New Bitmap ("path.file.ext") to create the bitmaps. I have a Select Case block to set
MyStatusPicture. I have included an "Imports
System.Drawing" stmt. But I can't seem to get the
StatusBarPanel to show the Bitmap. What am I missing?
How do I get the Status Bar to repaint that panel with the selected bitmap?

TIA,
Geoff


Nov 20 '05 #7
Thanks, Ken, that got me going! Much appreciated!
Geoff
-----Original Message-----
Hi,

Here is a link to the sample.
http://www.onteorasoftware.com/Downl...atusbardraw.zi p
To get the statusbar to redraw.
StatusBar1.Invalidate()

Ken
---------------------------
<an*******@discussions.microsoft.com> wrote in message
news:0a****************************@phx.gbl...
Ken,
Yes, that panel is already set to "ownerdraw", but ...

How do I make get the "statusbar drawitem" event
to "trigger"? I would expect a "method" so that I
could "invoke" it.

(Forgot to mention - I am using VB7, not C#.)

How do I access the msg attachment that contains the
simple example?

Thanks for your help.
Geoff
>-----Original Message-----
>Hi,
>
> You have to set the statusbarpanel style to
ownerdraw. Add code
>to the statusbar drawitem event. I attached a simple

example.
>
>Ken
>
>--------------------
>
>"Geoff" <ge***@tnhg.com> wrote in message
>news:07****************************@phx.gbl...
>> 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 panels to the status bar,
and I >> have used the Dim xxx As New Bitmap ("path.file.ext") to
>> create the bitmaps. I have a Select Case block to
set >> MyStatusPicture. I have included an "Imports
>> System.Drawing" stmt. But I can't seem to get the
>> StatusBarPanel to show the Bitmap. What am I missing? >> How do I get the Status Bar to repaint that panel

with the
>> selected bitmap?
>>
>> TIA,
>> Geoff
>
>
>

.

Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Tonya | last post: by
reply views Thread by Job Lot | last post: by
1 post views Thread by Oleg Medyanik | last post: by
1 post views Thread by Ahmet | last post: by
10 posts views Thread by Nicolas | last post: by
3 posts views Thread by EricJ | last post: by
3 posts views Thread by Fred Morrison | last post: by
6 posts views Thread by Anony | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.