zoukankan      html  css  js  c++  java
  • DevExpress的对话框XtraMessageBox的使用

    场景

    在Winform中一般弹出对话框使用的是MessageBox,而在

    DevExpress中使用的是XtraMessageBox实现对话框。

    效果

    实现

    首先新建确认按钮的调用方法:

    public DialogResult Confirm(string strString)
            {
                return DevExpress.XtraEditors.XtraMessageBox.Show(strString, "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            }

    然后在调用的地方

    if (isWriteX == true && isWriteY == true)
                {
                    if (this.Confirm("保存成功") == DialogResult.OK)
                        this.Dispose();
                }
                else
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show("保存失败", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                }

    其中DialogResult.OK就是点击确定后的效果,点击确定后将窗体关闭。

    其他效果:

    public enum DialogResult
        {
            // 摘要: 
            //     从对话框返回了 Nothing。这表明有模式对话框继续运行。
            None = 0,
            //
            // 摘要: 
            //     对话框的返回值是 OK(通常从标签为“确定”的按钮发送)。
            OK = 1,
            //
            // 摘要: 
            //     对话框的返回值是 Cancel(通常从标签为“取消”的按钮发送)。
            Cancel = 2,
            //
            // 摘要: 
            //     对话框的返回值是 Abort(通常从标签为“中止”的按钮发送)。
            Abort = 3,
            //
            // 摘要: 
            //     对话框的返回值是 Retry(通常从标签为“重试”的按钮发送)。
            Retry = 4,
            //
            // 摘要: 
            //     对话框的返回值是 Ignore(通常从标签为“忽略”的按钮发送)。
            Ignore = 5,
            //
            // 摘要: 
            //     对话框的返回值是 Yes(通常从标签为“是”的按钮发送)。
            Yes = 6,
            //
            // 摘要: 
            //     对话框的返回值是 No(通常从标签为“否”的按钮发送)。
            No = 7,
        }
    
     
  • 相关阅读:
    python3+spark2.1+kafka0.8+sparkStreaming
    python3.5读取kafka中的数据
    kafka启动及查看topic命令【已用过的,待更新】
    filebeat+kafka失败
    情侣浪漫网页制作
    侃侃静态代理和动态代理
    MyBatis增删改查模板
    虚拟机和Docker的异同
    <context:annotation-config/>,<mvc:annotation-driven/>和<context:component-scan>之间的关系
    异步上传图片到另外一台服务器
  • 原文地址:https://www.cnblogs.com/badaoliumangqizhi/p/11510611.html
Copyright © 2011-2022 走看看