Home All Groups Group Topic Archive Search About

Q: Message Box graphics

Author
9 Feb 2006 3:01 PM
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

Author
9 Feb 2006 3:33 PM
Herfried K. Wagner [MVP]
"Geoff" <nodamnspam@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/>
Author
9 Feb 2006 3:34 PM
Teemu
"Geoff" <nodamnspam@email.com> kirjoitti
viestissä:9dCdnRg5BdXP_XbeRVn***@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
Author
9 Feb 2006 6:10 PM
Geoff
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

Show quoteHide quote
"Teemu" <tsir***@hotmail.com> wrote in message
news:dsfne4$dva$1@phys-news4.kolumbus.fi...
>
> "Geoff" <nodamnspam@email.com> kirjoitti
> viestissä:9dCdnRg5BdXP_XbeRVn***@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
Author
9 Feb 2006 6:21 PM
Teemu
> 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
Author
9 Feb 2006 7:23 PM
Geoff
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

Show quoteHide quote
"Teemu" <tsir***@hotmail.com> wrote in message
news:dsg16a$9oi$1@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
Author
9 Feb 2006 7:49 PM
Teemu
"Geoff" <nodamnspam@email.com> kirjoitti
viestissä:KIadnZPrXYoCC3benZ2dnUVZ8t2dn***@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?

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
Author
9 Feb 2006 9:37 PM
Geoff
Hi Teemu

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

Geoff

Show quoteHide quote
"Teemu" <tsir***@hotmail.com> wrote in message
news:dsg6c0$ert$1@phys-news4.kolumbus.fi...
>
> "Geoff" <nodamnspam@email.com> kirjoitti
> viestissä:KIadnZPrXYoCC3benZ2dnUVZ8t2dn***@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?
>
> 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
Author
9 Feb 2006 8:10 PM
CMM
"Geoff" <nodamnspam@email.com> wrote in message
news:KIadnZPrXYoCC3benZ2dnUVZ8t2dnZ2d@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
Author
9 Feb 2006 9:38 PM
Geoff
Thanks CMM

Show quoteHide quote
"CMM" <cmm@nospam.com> wrote in message
news:%232pPTTbLGHA.3944@tk2msftngp13.phx.gbl...
> "Geoff" <nodamnspam@email.com> wrote in message
> news:KIadnZPrXYoCC3benZ2dnUVZ8t2dnZ2d@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
>
Author
9 Feb 2006 11:24 PM
Herfried K. Wagner [MVP]
"Geoff" <nodamnspam@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/>
Author
10 Feb 2006 11:11 AM
Geoff
Thanks Herfried. That worked a treat!

Geoff

Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:%23AoM4$cLGHA.2064@TK2MSFTNGP09.phx.gbl...
> "Geoff" <nodamnspam@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/>
Author
11 Feb 2006 4:25 PM
Eric Moreau
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/

Show quoteHide quote
"Geoff" <nodamnspam@email.com> wrote in message
news:9dCdnRg5BdXP_XbeRVny3g@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
>
>