最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
C#中Messagebox.Show()常用参数用法详解
时间:2022-06-25 08:15:08 编辑:袖梨 来源:一聚教程网
声明:IWin32Window owner , HelpNavigator navigator , string keyword
上面的三个参数类型不是很了解。没有做讨论。
等以后了解多了,再做补充。。。
下面讨论的一些常用参数,在平时使用,已经绰绰有余了。。。
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
下面是详细的代码 。
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 对话框_终极版
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(“ 1 个参数 ”
);
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show(“ 2 个参数。。 ”,
“亮仔提示”
);
}
private void button3_Click(object sender, EventArgs e)
{
MessageBox.Show(“ 3 个参数。。。 ”,
” 亮仔提示”,
MessageBoxButtons.YesNoCancel
);
}
private void button4_Click(object sender, EventArgs e)
{
MessageBox.Show(“ 4 个参数。。。 “,
” 亮仔提示”,
MessageBoxButtons.OKCancel,
MessageBoxIcon.Warning
);
}
private void button5_Click(object sender, EventArgs e)
{
MessageBox.Show(“ 5 个参数。。 。 “,
” 亮仔提示”,
MessageBoxButtons.OKCancel,
MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button2
);
}
private void button6_Click(object sender, EventArgs e)
{
MessageBox.Show(“ 6 个参数。。。 “,
” 亮仔提示”,
MessageBoxButtons.OKCancel,
MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button2,
MessageBoxOptions.RtlReading //ServiceNotification//.RightAlign // 标题向右对齐。
);
}
private void button7_Click(object sender, EventArgs e)
{
MessageBox.Show(“ 7 个参数。。帮助菜单不可用。。。。。 “,
” 亮仔提示”,
MessageBoxButtons.OKCancel,
MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button2,
MessageBoxOptions.RightAlign,
true // 标题向右对齐。。。。。 );
}
private void button8_Click(object sender, EventArgs e)
{
MessageBox.Show(“ 7 个参数。帮助菜单 可用。 “,
” 亮仔提示”,
MessageBoxButtons.OKCancel,
MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button2,
MessageBoxOptions.RightAlign , // 要使用默认风格,此处参数可设为 0
@”C:Documents and SettingsAdministrator桌面新建文本文档.txt”
);
}
相关文章
- 鸣潮2.7版本复刻角色都有谁 鸣潮2.7版本上下半卡池复刻角色一览 10-14
- 灵画师兑换码2025最新可用兑换码 灵画师兑换码大全汇总 10-14
- 盛世天下官方网站在哪 盛世天下官网首页入口 10-14
- 羊蹄山之魂是独占吗 羊蹄山之魂独占时间介绍 10-14
- 三角洲行动密码门大全(每日更新) 全地图今日密码更新汇总 10-14
- 羊蹄山之魂pc什么时候上 羊蹄山之魂pc版预计上线时间 10-14