zoukankan      html  css  js  c++  java
  • c#中MessageBox的使用(转)

    函数】 <整型> MessageBox(<字符串> Text, <字符串> Title, <整型> nType,MessageBoxIcon);
    【函数说明】 弹出一个消息框。
    【语法】
    参数:
    Text <字符串>,消息框的正文;
    Title <字符串>,消息框的标题;
    nType <整型>,消息框的类型。
    返回值:<整型>,用户在消息框上点击关闭时的选择的按钮。                                                                             MessageBoxIcon:对话框上显示的图标样式。


    【说明】
    MessageBox("消息内容", "返回值 确定1",MessageBoxButtons.OK,MessageBoxIcon.Question); 
    MessageBox("消息内容",, "返回值 确定1 取消2",MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);
    MessageBox("消息内容", "返回值 终止3 重试4 忽略5",MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error);
    MessageBox("消息内容",  "返回值 是6 否7 取消2",MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
    MessageBox("消息内容",  "返回值 是6 否7",MessageBoxButtons.YesNo, MessageBoxIcon.Hand);
    MessageBox("消息内容", "返回值 重试4 取消2",MessageBoxButtons.RetryCancel, MessageBoxIcon.Information);

    MessageBoxIcon: 所有图标样式

    MessageBoxIcon.Question                                                                                              MessageBoxIcon.Asterisk                                                                                                     MessageBoxIcon.Information                                                                                                      MessageBoxIcon.Error                                                                                                          MessageBoxIcon.Stop                                                                                                            MessageBoxIcon.Hand                                                                                                        MessageBoxIcon.Exclamation                                                                                                      MessageBoxIcon.Warning                                                                                                                        MessageBoxIcon.None

    MessageBox函数MessageBox()函数MessageBox是标准的windows Api函数只能在CWnd类的继承类中使用,在C#中使用时,通常用MessageBox的show方法来实现对话框的弹出,命名空间System.Windows.Forms

    应用实例:                                                                                                                                                                    DialogResult r1 = MessageBox.Show ( "是否确定?" , "垃圾处理!" , MessageBoxButtons.AbortRetryIgnore , MessageBoxIcon.Question ) ; 
       int ss1=(int)r1 ;
       if ( ss1==3 ){ }
       if ( ss1==4 ){ }
       if ( ss1==5){ }

    http://blog.csdn.net/jiangxinyu/article/details/2304114

  • 相关阅读:
    PHP流程控制考察点
    PHP运算符考察点
    PHP的魔术常量
    android窗体溢出WindowManager$BadTokenException: Unable to add window -- token null is not for an applica
    android网络访问异常java.lang.SecurityException: Permission denied (missing INTERNET permission?)
    快速排序算法思想
    播放Assets下的指定音频时,变成播放所有音频了
    python-01-Python环境搭建
    eclipse安装svn
    DOM children方法
  • 原文地址:https://www.cnblogs.com/yuxuetaoxp/p/2108720.html
Copyright © 2011-2022 走看看