I am creating a custom mailbox. How to use system images such as Error , Information , Warning , etc. that I see in MessageBox windows? I want to access them directly!
Error
Information
Warning
MessageBox
Take a look at System.Drawing.SystemIcons . You must find them there.
System.Drawing.SystemIcons
Then install the PictureBox (assuming Winforms here) as follows:
PictureBox
PictureBox1.Image = System.Drawing.SystemIcons.Warning.ToBitmap();
You need to look a little further into the message class. You can specify "MessageBoxIcon" when calling the method.
There are some good examples of how to achieve this here: http://www.dotnetperls.com/messagebox-show
You can draw system icons in your custom MessageBox by handling the Paint event, for example.
void MyMessageBox_Paint(object sender, PaintEventArgs e) { e.Graphics.DrawIcon(SystemIcons.Warning, 16, 16); }