Common Parameters of Messagebox. Show () in C #

Source: Internet
Author: User

Declaration: IWin32Window owner, HelpNavigator navigator, string keyword

The preceding three parameter types are not very well understood. Not discussed.

I will know more about it later, and then I will make a supplement...

 

Some of the common parameters discussed below are more than enough in normal use...

//////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// ///////////

The following is the detailed code.

 

Using System;
Using System. Collections. Generic;
Using System. ComponentModel;
Using System. Data;
Using System. Drawing;
Using System. Linq;
Using System. Text;
Using System. Windows. Forms;

Namespace dialog box _ release Edition
{
Public partial class Form1: Form
{
Public Form1 ()
{
InitializeComponent ();
}

Private void button#click (object sender, EventArgs e)
{
MessageBox. Show ("1 parameter www. bKjia. c0m"
);
}

 

 

 

 

Private void button2_Click (object sender, EventArgs e)
{
MessageBox. Show ("2 parameters .. ",
"Liangzai prompt"
);
}


 
Private void button3_Click (object sender, EventArgs e)
{
MessageBox. Show ("3 parameters... ",
"Notice ",
MessageBoxButtons. YesNoCancel
);
}

 

 

 

 
Private void button4_Click (object sender, EventArgs e)
{
MessageBox. Show ("4 parameters... ",
"Notice ",
MessageBoxButtons. OKCancel,
MessageBoxIcon. Warning
);
}

 

 

 

 

 

 

Private void button5_Click (object sender, EventArgs e)
{
MessageBox. Show ("5 parameters .. . ",
"Notice ",
MessageBoxButtons. OKCancel,
MessageBoxIcon. Warning,
MessageBoxDefaultButton. Button2
);
}

 

 

 

 

 

 

Private void button6_Click (object sender, EventArgs e)
{
MessageBox. Show ("6 parameters... ",
"Notice ",
MessageBoxButtons. OKCancel,
MessageBoxIcon. Warning,
MessageBoxDefaultButton. Button2,
MessageBoxOptions. RtlReading // ServiceNotification //. RightAlign // align the title to the right.
);

}

 

 

 

 

 
Private void button7_Click (object sender, EventArgs e)
{
MessageBox. Show ("7 parameters .. The Help menu is unavailable ..... ",
"Notice ",
MessageBoxButtons. OKCancel,
MessageBoxIcon. Warning,
MessageBoxDefaultButton. Button2,
MessageBoxOptions. RightAlign,
True // The title is right aligned ..... );

}


 

 

 

 

Private void button8_Click (object sender, EventArgs e)
{
MessageBox. Show ("7 parameters. The Help menu is available. ",
"Notice ",
MessageBoxButtons. OKCancel,
MessageBoxIcon. Warning,
MessageBoxDefaultButton. Button2,
MessageBoxOptions. RightAlign, // use the default style. The parameter can be set to 0.
@ "C: Documents and settingsadministrator 文.txt .txt"
);
}


}
}

 

For more details, see http://www.bKjia. c0m/net/160/56737 .htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.