转载:(238条消息) MessageBox.Show 参数详解_书启秋枫的博客-优快云博客
1. 准备好样式
样式链接地址:C#创建Windows窗体应用程序实例1正在上传…重新上传取消https://blog.youkuaiyun.com/qq_45037155/article/details/124005398
2. 一个参数
MessageBox.Show(textBox1.Text + " 登录成功!");
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(textBox1.Text + " 登录成功!");
}
3. 二个参数
MessageBox.Show(textBox1.Text + " 登录成功!","登录提醒");
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(textBox1.Text + " 登录成功!","登录提醒");
}
4. 三个参数
MessageBox.Show(textBox1.Text + " 登录成功!","登录提醒",MessageBoxButtons.YesNo);
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(textBox1.Text + " 登录成功!","登录提醒",MessageBoxButtons.YesNo);
}
5. 四个参数
MessageBox.Show(textBox1.Text + " 登录成功!","登录提醒",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(textBox1.Text + " 登录成功!","登录提醒",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
}