MessageboxShow常用参数_第1页
MessageboxShow常用参数_第2页
MessageboxShow常用参数_第3页
MessageboxShow常用参数_第4页
MessageboxShow常用参数_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论