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

Q: Message Box graphics

P: n/a
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
Feb 9 '06 #1
Share this Question
Share on Google+
12 Replies


P: n/a

"Geoff" <no********@email.com> kirjoitti
viestissä:9d********************@pipex.net...
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

Feb 9 '06 #2

P: n/a
"Geoff" <no********@email.com> schrieb:
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'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Feb 9 '06 #3

P: n/a
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

"Teemu" <ts*****@hotmail.com> wrote in message
news:ds**********@phys-news4.kolumbus.fi...

"Geoff" <no********@email.com> kirjoitti
viestissä:9d********************@pipex.net...
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

Feb 9 '06 #4

P: n/a
> 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
Feb 9 '06 #5

P: n/a
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

"Teemu" <ts*****@hotmail.com> wrote in message
news:ds**********@phys-news4.kolumbus.fi...
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

Feb 9 '06 #6

P: n/a

"Geoff" <no********@email.com> kirjoitti
viestissä:KI******************************@pipex.n et...
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

Feb 9 '06 #7

P: n/a
CMM
"Geoff" <no********@email.com> wrote in message
news:KI******************************@pipex.net...
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.

--
-C. Moya
www.cmoya.com
Feb 9 '06 #8

P: n/a
Hi Teemu

No, I'm using 2003. Thanks for the code. I'll give it a try.

Geoff

"Teemu" <ts*****@hotmail.com> wrote in message
news:ds**********@phys-news4.kolumbus.fi...

"Geoff" <no********@email.com> kirjoitti
viestissä:KI******************************@pipex.n et...
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

Feb 9 '06 #9

P: n/a
Thanks CMM

"CMM" <cm*@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"Geoff" <no********@email.com> wrote in message
news:KI******************************@pipex.net...
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.

--
-C. Moya
www.cmoya.com

Feb 9 '06 #10

P: n/a
"Geoff" <no********@email.com> schrieb:
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."

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Feb 9 '06 #11

P: n/a
Thanks Herfried. That worked a treat!

Geoff

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Geoff" <no********@email.com> schrieb:
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."

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Feb 10 '06 #12

P: n/a
I have written my own MessageBox replacement. See it in my article of
January 2006 at http://emoreau.s2i.com/

--
HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Concept S2i inc. (www.s2i.com)
http://emoreau.s2i.com/

"Geoff" <no********@email.com> wrote in message
news:9d********************@pipex.net...
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

Feb 11 '06 #13

This discussion thread is closed

Replies have been disabled for this discussion.