Q: Message Box graphics

  • Thread starter Thread starter Geoff
  • Start date Start date
G

Geoff

Hi

I was wondering if anybody could tell me how to find the graphics used in
such things as

MessageBoxIcon.Warning and MessageBoxIcon.Information

The reason is that I'm writing my own customised messages for an applicatio
i.e. not using MessageBox but I'd still like to use the same Windows
graphics. I'm using XP professional by the way.

Thanks in advance

Geoff
 
Geoff said:
I was wondering if anybody could tell me how to find the graphics used in
such things as

MessageBoxIcon.Warning and MessageBoxIcon.Information

Check out 'SystemIcons'.
 
Geoff said:
Hi

I was wondering if anybody could tell me how to find the graphics used in
such things as

MessageBoxIcon.Warning and MessageBoxIcon.Information

The reason is that I'm writing my own customised messages for an
applicatio i.e. not using MessageBox but I'd still like to use the same
Windows graphics. I'm using XP professional by the way.


Take a look at System.Drawing.SystemIcons. You'll find those icons there.

Teemu
 
Hi guys

Yes, that works, however there is a black edge around the icon. I'm putting
a PictureBox on the form (which has itself a bitmap background) and in the
load event using:

PictureBox1.SystemIcons.Information.ToBitmap

Can you suggest how I could get rid of the edge?

Geoff
 
PictureBox1.SystemIcons.Information.ToBitmap
Can you suggest how I could get rid of the edge?

I tried:

PictureBox1.Image = Drawing.SystemIcons.Warning.ToBitmap

and wasn't able to see any edges. Have you tried this?

-Teemu
 
It isn't as prominent using "Warning" but still there. Is there a way I can
find the icon files in the Windows folder?

Geoff
 
Geoff said:
It isn't as prominent using "Warning" but still there. Is there a way I
can find the icon files in the Windows folder?

I tested this more. I created following code:

Form1.BackgroundImage = New Bitmap("c:\MyImage.jpg")
PictureBox1.BackColor = Color.Transparent
PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize
PictureBox1.Image = Drawing.SystemIcons.Information.ToBitmap

Information icon rendered very nicely without any edges or other borders.
Hopefully you get it work now. I can't see any reason why it would behave
differently with you. Are you using Visual Basic 2005?

Teemu
 
Geoff said:
It isn't as prominent using "Warning" but still there. Is there a way I
can find the icon files in the Windows folder?

Check in Shell32.dll and Explorer.exe. They're in there. You can browse and
extract (save as .ICO) the icons (and other resources) of these exe and
dll's in Visual Studio using File | Open File.
 
Thanks CMM

CMM said:
Check in Shell32.dll and Explorer.exe. They're in there. You can browse
and extract (save as .ICO) the icons (and other resources) of these exe
and dll's in Visual Studio using File | Open File.
 
Geoff said:
Yes, that works, however there is a black edge around the icon. I'm
putting a PictureBox on the form (which has itself a bitmap background)
and in the load event using:

PictureBox1.SystemIcons.Information.ToBitmap

Can you suggest how I could get rid of the edge?

<URL:http://www.dotnetrix.co.uk/misc.html>
-> "Get Alpha Bitmap from 32 bit Icon."
 
Back
Top