效果图:

前台调用:

 //图一的前台调用
MessageBox.Show("测试", "标题", MessageBoxButtons.OK); //图二的前台调用
Functionjsj.ShowMsg("测试", Functionjsj.MsgType.OK);

说明:

        Functionjsj 为自定义类:下有三种类型的输出:

     Functionjsj.ShowMsg(消息, 枚举类型);
            Functionjsj.ShowMsg(消息, 标题, 枚举类型);
            Functionjsj.ShowMsgBox(消息, 标题, 枚举类型);

底层类:

#region DevExpress MessageBox 弹出框

        #region 枚举弹出类型
public enum MsgType {
/// <summary>
/// 提示
/// </summary>
OK = 0,
/// <summary>
/// 警告
/// </summary>
Warning = 1,
/// <summary>
/// 询问
/// </summary>
Question = 2,
/// <summary>
/// 错误
/// </summary>
Exception = 3,
/// <summary>
/// 是/否/取消
/// </summary>
YesNoCancel = 4,
/// <summary>
/// 是/否
/// </summary>
YesNo = 5
}
#endregion /// <summary>
/// 显示消息
/// </summary>
/// <param name="msg">消息</param>
/// <param name="ie">消息类型</param>
/// <returns>需要用户作出选择时,返回YES or NO,否则返回,ok,cancel等</returns>
public static System.Windows.Forms.DialogResult ShowMsg(string msg, MsgType msgType)
{
switch (msgType)
{
case MsgType.OK:
return ShowMsg(msg, "信息", MsgType.OK);
case MsgType.Question:
return ShowMsg(msg, "确认", MsgType.Question);
case MsgType.Warning:
return ShowMsg(msg, "警告", MsgType.Warning);
case MsgType.Exception:
Exception(msg);
return System.Windows.Forms.DialogResult.OK;
case MsgType.YesNoCancel:
return ShowMsg(msg, "请选择", MsgType.YesNoCancel);
case MsgType.YesNo:
return ShowMsg(msg, "请选择", MsgType.YesNo);
default:
return System.Windows.Forms.DialogResult.Cancel;
}
} /// <summary>
/// 显示消息
/// </summary>
/// <param name="msg">消息</param>
/// <param name="caption">标题 系统会自动加上一些信息</param>
/// <param name="msgType">消息类型</param>
/// <returns>需要用户作出选择时,返回YES or NO,否则返回,ok,cancel等</returns>
public static System.Windows.Forms.DialogResult ShowMsg(string msg, string caption, MsgType msgType)
{
switch (msgType)
{
case MsgType.OK:
return ShowMsgBox(msg, caption, msgType);
case MsgType.Question:
return ShowMsgBox(msg, caption, msgType);
case MsgType.Warning:
return ShowMsgBox(msg, caption, msgType);
case MsgType.Exception:
Exception(msg);
return System.Windows.Forms.DialogResult.OK;
case MsgType.YesNoCancel:
return ShowMsgBox(msg, caption, msgType);
case MsgType.YesNo:
return ShowMsgBox(msg, caption, msgType);
default:
return System.Windows.Forms.DialogResult.Cancel;
}
} /// <summary>
/// 显示消息
/// </summary>
/// <param name="msg">消息</param>
/// <param name="catpion">标题</param>
/// <param name="msgType">消息类型</param>
/// <returns>需要用户作出选择时,返回YES or NO,否则返回,ok,cancel等</returns>
public static System.Windows.Forms.DialogResult ShowMsgBox(string msg, string catpion, MsgType msgType)
{
switch (msgType)
{
case MsgType.OK:
return Show(msg, catpion, System.Windows.Forms.MessageBoxButtons.OK);
case MsgType.Question:
return Question(msg, catpion, System.Windows.Forms.MessageBoxButtons.OKCancel, MessageBoxDefaultButton.Button2);
case MsgType.Warning:
return Warning(msg, catpion, System.Windows.Forms.MessageBoxButtons.OK);
case MsgType.Exception:
Exception(msg);
return System.Windows.Forms.DialogResult.OK;
case MsgType.YesNoCancel:
return Information(msg, catpion, System.Windows.Forms.MessageBoxButtons.YesNoCancel, MessageBoxDefaultButton.Button3);
case MsgType.YesNo:
return Information(msg, catpion, System.Windows.Forms.MessageBoxButtons.YesNo, MessageBoxDefaultButton.Button2);
default:
return System.Windows.Forms.DialogResult.Cancel;
}
} /// <summary>
/// 显示消息
/// </summary>
/// <param name="msg">消息</param>
/// <param name="ie">消息类型</param>
/// <returns>需要用户作出选择时,返回YES or NO,否则返回,ok,cancel等</returns>
public static System.Windows.Forms.DialogResult ShowMsg(IWin32Window owner, string msg, MsgType msgType)
{
switch (msgType)
{
case MsgType.OK:
return Show(msg, "信息", System.Windows.Forms.MessageBoxButtons.OK);
case MsgType.Question:
return Question(msg, "确认", System.Windows.Forms.MessageBoxButtons.OKCancel, MessageBoxDefaultButton.Button2);
case MsgType.Warning:
return Warning(msg, "警告", System.Windows.Forms.MessageBoxButtons.OK);
case MsgType.Exception:
Exception(msg);
return System.Windows.Forms.DialogResult.OK;
case MsgType.YesNoCancel:
return Information(msg, "请选择", System.Windows.Forms.MessageBoxButtons.YesNoCancel, MessageBoxDefaultButton.Button3);
default:
return System.Windows.Forms.DialogResult.Cancel;
}
} #region Show
public static DialogResult Show(string text)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text);
} public static DialogResult Show(string text, string caption)
{ return DevExpress.XtraEditors.XtraMessageBox.Show(text, caption);
} public static DialogResult Show(string text, string caption, MessageBoxButtons buttons)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, buttons, MessageBoxIcon.Information);
} public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(owner, text, caption, buttons, MessageBoxIcon.Information);
} public static DialogResult Show(string text, string caption, System.Windows.Forms.MessageBoxButtons buttons, MessageBoxIcon icon)
{ return DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, buttons, icon);
} public static DialogResult Show(IWin32Window owner, string text, string caption, System.Windows.Forms.MessageBoxButtons buttons, MessageBoxIcon icon)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(owner, text, caption, buttons, icon);
}
#endregion #region Information public static DialogResult Information(string message)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(message, " 消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
} public static DialogResult Information(string message, string caption)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(message, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
} public static DialogResult Information(string message, string caption, MessageBoxButtons buttons)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(message, caption, buttons, MessageBoxIcon.Information);
}
public static DialogResult Information(string message, string caption, MessageBoxButtons buttons, MessageBoxDefaultButton defButton)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(message, caption, buttons, MessageBoxIcon.Information, defButton);
}
#endregion #region Question public static DialogResult Question(string text)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, "疑问", MessageBoxButtons.OK, MessageBoxIcon.Question);
}
public static DialogResult Question(string text, string caption)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Question);
}
public static DialogResult Question(string text, string caption, MessageBoxButtons buttons)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, buttons, MessageBoxIcon.Question);
} public static DialogResult Question(string text, string caption, MessageBoxButtons buttons, MessageBoxDefaultButton defButton)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, buttons, MessageBoxIcon.Question, defButton);
} #endregion #region Warning
public static DialogResult Warning(string text)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
public static DialogResult Warning(string text, string caption)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
public static DialogResult Warning(string text, string caption, MessageBoxButtons buttons)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, buttons, MessageBoxIcon.Warning);
}
#endregion #region Exception
public static DialogResult Exception(string text)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
public static DialogResult Exception(string text, string caption)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
public static DialogResult Exception(string text, string caption, MessageBoxButtons buttons)
{
return DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, buttons, MessageBoxIcon.Error);
}
#endregion #endregion

版权声明:本文为博主原创文章,未经博主允许不得转载。

DevExpress MessageBox 弹出框 底层类的更多相关文章

  1. Tkinter 之MessageBox弹出框

    一.参数说明 语法 作用 截图 tk.messagebox.showwarning(title='提示', message='你确定要删除吗?') 警告信息弹窗   tk.messagebox.sho ...

  2. 弹出框,先弹出遮罩有透明度灰色100%高宽,置顶z-index:999---再弹出框最顶部z-index:9999

    <div class="mask"></div> <div class="maskbox"> <form id=&qu ...

  3. Windows Phone 几种弹出框提示方式

    首先,我们需要在网络上下载一个Coding4Fun 然后,引用  using Coding4Fun.Phone.Controls.Toolkit;                using Codin ...

  4. MessageBox页面消息弹出框类

    MessageBox页面消息弹出框类: public class MessageBox { /// <summary> /// 自定义弹出窗口内容,不跳转 /// </summary ...

  5. 通过script src引入ElementUI时,使用语句:window.ELEMENT.MessageBox.alert(xxx) 调用弹出框

    通过script src引入ElementUI时,使用语句:window.ELEMENT.MessageBox.alert(xxx) 调用弹出框.

  6. 干掉MessageBox,自定义弹出框JMessbox (WindowsPhone)

    先上效果图                                               QQ退出效果                                           ...

  7. python + selenium webdriver 通过python来模拟鼠标、键盘操作,来解决SWFFileUpload调用系统底层弹出框无法定位问题

    Webdriver是基于浏览器操作的,当页面上传文件使用的是flash的控件SWFFileUpload调用的时候,调用的是系统底层的文件选择弹出框 这种情况,Webdriver暂时是不支持除页面外的其 ...

  8. QMessageBox 弹出框上的按钮设置为中文

    Qt 默认的弹出框上的按钮式英文,虽然也知道是什么意思,但终究不如中文看着顺眼. QMessageBox box(QMessageBox::Warning,"标题","弹 ...

  9. JavaScript插件——弹出框

    (JavaScript插件——弹出框) 前言 阅读之前您也可以到Bootstrap3.0入门学习系列导航中进行查看http://www.cnblogs.com/aehyok/p/3404867.htm ...

随机推荐

  1. java 发布和逸出

    [转载]:http://www.2cto.com/kf/201310/247738.html 前言 多线程并发环境下,线程安全极为重要.往往一些问题的发生都是由于不正确的发布了对象造成了对象逸出而引起 ...

  2. EWS小记

    前段时间和同事完成了一个Exchange 2010 OWA的改造版,他狠狠的把网易邮箱抄了一把,而我则狠狠的被EWS坑了一把.今天打开项目粗略看了一下,发现很多东西都有点记不起来了,思细极恐,决定还是 ...

  3. xxx couldn't be loaded because it has not been added to the build settings.

    这个由于没有将进入场景放入Build Settings里面造成的.

  4. angular2地址栏路由配置

    一步一步route过去可以,地址栏直接写url怎么就找不到了呢? 这关乎于Nodejs的express路由规则(http://hm4123660.iteye.com/blog/2195035) exp ...

  5. String类的split方法以及StringTokenizer

    split方法可以根据指定的表达式regex将一个字符串分割成一个子字符串数组. 它的参数有两种形式,也即:split(String regex)和split(String regex, int li ...

  6. HDU 1059 Dividing(多重背包)

    点我看题目 题意: 将大理石的重量分为六个等级,每个等级所在的数字代表这个等级的大理石的数量,如果是0说明这个重量的大理石没有.将其按重量分成两份,看能否分成. 思路 :一开始以为是简单的01背包,结 ...

  7. POJ 2942 Knights of the Round Table(双连通分量)

    http://poj.org/problem?id=2942 题意 :n个骑士举行圆桌会议,每次会议应至少3个骑士参加,且相互憎恨的骑士不能坐在圆桌旁的相邻位置.如果意见发生分歧,则需要举手表决,因此 ...

  8. HDOJ 4893 Wow! Such Sequence!

    题意是这样的,给定一个n个元素的数组,初始值为0,3种操作: 1 k d将第k个数增加d: 2 l r 询问区间l...r范围内数之和: 3 l r 表示将区间l...r内的数变成离他最近的斐波那契数 ...

  9. 丢手帕问题(环形链表)---Java 待优化

    /** * * @author Administrator * 功能:丢手帕问题 */ package com.litao; public class Demo4 { /** * @param arg ...

  10. bzoj3611

    会构建虚树之后就是noip提高组的题目了稍微难一点的是求代价和,只要注意按一个方向避免重复计算贡献即可 ; type node=record po,next:longint; end; ..] of ...