Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use System Images in C#

Tags:

c#

I am creating a custom messagebox. How can I use system pictures such as Error, Information, Warning and etc, which I see in windows MessageBox? I want to access them directly!

like image 881
ramezani.saleh Avatar asked Mar 28 '11 10:03

ramezani.saleh


1 Answers

Take a look at System.Drawing.SystemIcons. You should find them there.

Then set your PictureBox (assuming Winforms here) like this:

PictureBox1.Image = System.Drawing.SystemIcons.Warning.ToBitmap();
like image 187
Kristoffer Lindvall Avatar answered Nov 15 '22 23:11

Kristoffer Lindvall