




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、private void button1_Click(object sender, EventArgs e) ( MessageBox.Show( ); private void button2_Click(object sender, EventArgs e) ( MessageBox.Show( 2 个参数。 , 亮仔提示 ); ) private void button3_Click(object sender, EventArgs e) ( MessageBox.Show( 3 个参数。 , 亮仔提示, MessageBoxButtons.YesNoCancel ); 亮仔提示 rtj
2、i 否(H) | 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, Messag
3、eBoxDefaultButton.Button2 ); 凳仔提示 r 5个参数口 D o private void button6_Click(object sender, EventArgs e) ( MessageBox.Show( 6 个参数。 , 亮仔提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, MessageBoxOptions.RtlReading RightAlign / 标题向右对齐。 ); private void button7_Click(
4、object sender, EventArgs e) ( MessageBox.Show( 7个参数。帮助菜单不可用 亮仔提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning,/ServiceNotification/. 1. 1 个参数 MessageBoxDefaultButton.Button2, MessageBoxOptions.RightAlign, true /标题向右对齐。 7个参数口 o帮助菜单不可用 确定ir取消j |帮助 private void button8_Click(object sender, Event
5、Args e) MessageBox.Show( 7个参数。帮助菜单 可用。 , 亮仔提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, MessageBoxOptions.RightAlign , / 要使用默认风格,此处参 数可设为0 桌面新建文本 文档.txt ); ) ); MessageBox.Show(string text); / 显示具有指定文本的消息框。 /参数:text: 要在消息框中显示的文本。 / 返回结果:System.Windows.Form
6、s.DialogResult 值之一。 2. 2 个参数。 MessageBox.Show(string text, string caption); / 显示具有指定文本和标题的消息框。 /参数: / text: 要在消息框中显示的文本。 / caption: 要在消息框的标题栏中显示的文本。 / 返回结果:System.Windows.Forms.DialogResult 值之一 3. 3 个参数。 MessageBox.Show(string text, string caption, MessageBoxButtons buttons); / 显示具有指定文本、标题和按钮的消息框。 /
7、参数: / text: 要在消息框中显示的文本。 / caption: 要在消息框的标题栏中显示的文本。 / buttons: System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显 示哪些按钮。 / 返回结果:System.Windows.Forms.DialogResult 值之一。 /异常: /System.ComponentModel.InvalidEnumArgumentException: System.Windows.Forms.MessageBoxButtons 的成员。指定的buttons 参数不是 / System.Inva
8、lidOperationException: 试图在运行模式不是用户交互模式的进程中显 示 System.Windows.Forms.MessageBox 。这是由 System.Windows.Forms.SystemInformation.UserInteractive 属性指定的。 4. 4 个参数。 MessageBox.Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon); / 显示具有指定文本、标题、按钮和图标的消息框。 / / text: 要在消息框中显示的文本。 / c
9、aption: 要在消息框的标题栏中显示的文本。 buttons: / 示哪些按钮。 System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显 / icon: System.Windows.Forms.MessageBoxIcon 图标。 值之一,它指定在消息框中显示哪个 / 返回结果:System.Windows.Forms.DialogResult 值之一。 / 异常: / System.ComponentModel.InvalidEnumArgumentException: 的成员。 的成员。 是 System.Windows.Forms.
10、MessageBoxButtons System.Windows.Forms.MessageBoxIcon 指定的buttons 参数不 或-指定的icon24参数不是 / System.InvalidOperationException: 示 System.Windows.Forms.MessageBox System.Windows.Forms.SystemInformation.UserInteractive 试图在运行模式不是用户交互模式的进程中显 这是由 属性指定的。 5. 5 个参数。 MessageBox.Show(string text, string caption, Mes
11、sageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton); / 显示具有指定文本、标题、按钮、图标和默认按钮的消息框。 /参数: / caption: 要在消息框的标题栏中显示的文本。 / buttons: System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显 示哪些按钮。 / icon: System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个 图标。 / default Button
12、: System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定 消息框中的默认按钮。 / 返回结果:System.Windows.Forms.DialogResult 值之一。 /异常: / System.ComponentModel.InvalidEnumArgumentException: buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。-或-icon 不是 System.Windows.Forms.MessageBoxIcon 的成员。-或-defaultButton 不是 Syst
13、em.Windows.Forms.MessageBoxDefaultButton 的成员。 / System.InvalidOperationException: 试图在运行模式不是用户交互模式的进程中显 示 System.Windows.Forms.MessageBox 。这是由 System.Windows.Forms.SystemInformation.UserInteractive 属性指定的。 6. 6 个参数。 MessageBox.Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon
14、 icon,MessageBoxDefaultButton defaultButton, MessageBoxOptions options); / 显示具有指定文本、标题、按钮、图标、默认按钮和选项的消息框。 /参数: / text: 要在消息框中显示的文本。 / caption: 要在消息框的标题栏中显示的文本 / buttons: System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示 哪些按钮。 / icon: System.Windows.Forms.MessageBoxIcon 图标。/ text: 要在消息框中显示的文本 值之一
15、,它指定在消息框中显示哪个 值之一,可指定 / defaultButton: System.Windows.Forms.MessageBoxDefaultButton 消息框中的默认按钮。 / options: System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使 用哪些显示和关联选项。若要使用默认值,请传入 0。 / 返回结果:System.Windows.Forms.DialogResult 值之一。 /异常: / System.ComponentModel.InvalidEnumArgumentException: buttons 不是
16、 System.Windows.Forms.MessageBoxButtons 的成员。-或-icon 不是 System.Windows.Forms.MessageBoxIcon 的成员。-或-指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton 的成员。 / System.InvalidOperationException: 试图在运行模式不是用户交互模式的进程中显 示 System.Windows.Forms.MessageBox 。这是由 System.Windows.Forms.SystemInformat
17、ion.UserInteractive 属性指定的。 / System.ArgumentException: options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly System.Windows.Forms.MessageBoxOptions.ServiceNotification 无效的 System.Windows.Forms.MessageBoxButtons 组合。 7. 7 个参数一。 MessageBox.Show(string text, string caption, MessageBoxB
18、uttons buttons, MessageBoxIcon icon,MessageBoxDefaultButton defaultButton, MessageBoxOptions options, bool displayHelpButton); / 显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。 /参数: / text: 要在消息框中显示的文本。 / caption: 要在消息框的标题栏中显示的文本。 / buttons: System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显 示哪些按钮。 / icon
19、: System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个 图标。和 。-或-buttons42 指定了 值之一,可指定 / defaultButton: System.Windows.Forms.MessageBoxDefaultButton 消息框中的默认按钮。 / options: System.Windows.Forms.MessageBoxOptions 用哪些显示和关联选项。若要使用默认值,请传入 0。 / helpButton: 如果显示“帮助”按钮,则为 true ;否则为false 。默认为false / 返回结果:Syste
20、m.Windows.Forms.DialogResult 值之一。 / 异常:34 / System.ComponentModel.InvalidEnumArgumentException: buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。-或-icon 不是 System.Windows.Forms.MessageBoxIcon 的成员。-或-指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton 的成员。 / System.InvalidOperation
21、Exception: 试图在运行模式不是用户交互模式的进程中显 示 System.Windows.Forms.MessageBox 。这是由 System.Windows.Forms.SystemInformation.UserInteractive 属性指定的。 / System.ArgumentException: options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly System.Windows.Forms.MessageBoxOptions.ServiceNotification 效的 Syste
22、m.Windows.Forms.MessageBoxButtons 组合。 8. 7 个参数二 MessageBox.Show(string text, string caption, MessageBoxButtons buttons,MessageBoxIcon icon, MessageBoxDefaultButton defaultButton,MessageBoxOptions options, string helpFilePath); / 使用指定的帮助文件显示一个具有指定文本、 标题、按钮、图标、默认按钮、选项和“帮 助”按钮的消息框。 /参数: / text: 要在消息框中显
23、示的文本。 / caption: 要在消息框的标题栏中显示的文本。 / buttons: System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显 示哪些按钮。值之一,可指定将对消息框使 和 。- 或-buttons 指定了无 值之一,它指定在消息框中显示哪个 / icon: System.Windows.Forms.MessageBoxIcon 图标。 / defaultButton: System.Windows.Forms.MessageBoxDefaultButton 消息框中的默认按钮。 / options: System.Windows.Forms.Message
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 固态电池生产车间布局设计方案
- 2025年值班工考试试题及答案
- 建筑节能检测技术方案
- 建筑节能工程验收方案
- 房屋建筑外部供水设计方案
- 城市地下空间开发方案
- 住宅项目临时设施与施工组织方案
- 化工新材料生产线项目建筑工程方案
- 水浸事故应急预案会议内容
- 信息系统方案咨询
- 物业房屋租赁合同模板
- 2022城市轨道交通列车驾驶员技能及素质要求第1部分:地铁、轻轨和单轨
- 蓝桥杯c语言历届试题及答案
- 金融风险管理习题第1-13章金融风险概述思考题-经济资本与风险调整绩效
- 2024-2025学年高一下学期时间管理主题班会课件
- 2024国家安全教育大学生读本题库
- 《万以内的加减法》课件
- 《国际贸易学(第四版)》第七章-关税措施
- DB11-T 1891-2021 建(构)筑物与应急设施地震安全韧性建设指南
- 学生作文稿纸(A4打印)
- 三垦变频器说明书
评论
0/150
提交评论