Put a picture in a StatusBar Panel

G

Geoff

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
 
C

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
//
 
H

Herfried K. Wagner [MVP]

* "Geoff said:
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.
 
G

Guest

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
 
G

Guest

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 said:
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( _
 
H

Herfried K. Wagner [MVP]

* said:
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').
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top