messagebox icons

  • Thread starter Thread starter Octavio Hernandez
  • Start date Start date
O

Octavio Hernandez

Hi, Alvo!

Use another version of Show():

MessageBox.Show(
"cheese",
"is tasty",
MessageBoxButtons.Ok, // YesNo, YesNoCancel, etc.
MessageBoxIcon.Warning); // Exclamation, Asterisk, etc.

Regards - Octavio
 
hi,

i am creating an app wich uses lots of messageboxes.

messagrbox.show("cheese", "is tasty");sets the message's title to cheese and
the text is "is tasty". how do i change the iocon for it e.g. warning (a red
exclamation mark)?

thanks in advance
 
Hi Alvo,

Below is an example:

MessageBox.Show(
this, // needs a reference to the "Owner" form
"this is my text", // text to be shown in the message box
"this is the caption", // Title of the message box
MessageBoxButtons.OK, // Button to show
MessageBoxIcon.Warning); // Icon to show

MessageBox.Show() has several overloads, the one shown above gives you
the most flexibility, allowing you to pass in both the Buttons and the Icon.

Regards,

Bennie Haelen
 
Back
Top