:
Foreground call:
Figure one of the foreground call MessageBox.Show ("Test", "title", MessageBoxButtons.OK); Figure II of the foreground call functionjsj.showmsg ("test", Functionjsj.MsgType.OK);
Description
FUNCTIONJSJ is a custom class: There are three types of output:
functionjsj.showmsg (message, enumeration type);
functionjsj.showmsg (message, title, enum type);
functionjsj.showmsgbox (message, title, enumeration type);
underlying class:
#region DevExpress MessageBox Popup #region Enumeration popup type public enum Msgtype {//<summary> Tip///</summary> OK = 0,///<summary>//Warning </summary> Warning = 1,///<summary>//</summary > Question = 2,///<summary>//Error//</summary> Exception = 3,//<summary>//Yes/no/cancel//</summary> Yesnocancel = 4,///<summary>//no/////</summary> YesNo = 5 } #endregion///<summary>///Show messages///</summary>//<param name= "Ms G "> Messages </param>//<param name=" ie "> Message types </param>//<returns> require user to make a selection, return Yes or N O, otherwise return, Ok,cancel etc </returns> public static System.Windows.Forms.DialogResult showmsg (String msg, Msgtype Msgtype) { Switch (msgtype) {case MsgType.OK:return showmsg (msg, "Information", Msgtype.ok); Case MsgType.Question:return showmsg (msg, "confirmation", msgtype.question); Case MsgType.Warning:return showmsg (msg, "warning", msgtype.warning); Case MsgType.Exception:Exception (msg); return System.Windows.Forms.DialogResult.OK; Case MsgType.YesNoCancel:return showmsg (msg, "Please select", msgtype.yesnocancel); Case MsgType.YesNo:return showmsg (msg, "Please select", Msgtype.yesno); Default:return System.Windows.Forms.DialogResult.Cancel; }}///<summary>///Show message///</summary>//<param name= "MSG "> Messages </param>//<param Name=" caption "> title system will automatically add some information </param>//<param name=" Ms GType "> Message type </param>//<returns> require user to make a selection, return Yes or NO, otherwise return, Ok,cancel etc </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>///Show messages///</summary>//<param name= "MSG" > Messages < ;/param>//<param name= "catpion" > Title </param>//<param name= "Msgtype" > Message type </param& Gt <returns> require user to make a selection, return Yes or NO, otherwise return, Ok,cancel </returns> public static System.Windows.Forms.DialogR Esult 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.OKCa Ncel, 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.YesN Ocancel, Messageboxdefaultbutton.button3); Case MsgType.YesNo:return Information (msg, catpion, System.Windows.Forms.MessageBoxButtons.YesNo, Mes Sageboxdefaultbutton.button2); Default:return System.Windows.Forms.DialogResult.Cancel; }}///<summary>///Show messages///</summary>//<param name= "MSG" > Messages < ;/param>//<param name= "ie" > Message type </param>//<returns> require user to make a selection, return Yes or NO, otherwise return, ok,c Ancel et </returns> public static System.Windows.Forms.DialogResult showmsg (IWin32Window owner, string msg, MSgt Ype Msgtype) {switch (msgtype) {case MsgType.OK:return Show (msg, "info", System.Windows.Forms.MessageBoxButtons.OK); Case MsgType.Question:return Question (msg, "Confirmation", System.Windows.Forms.MessageBoxButtons.OKCancel, Mess Ageboxdefaultbutton.button2); Case MsgType.Warning:return Warning (msg, "warning", System.Windows.Forms.MessageBoxButtons.OK); Case MsgType.Exception:Exception (msg); return System.Windows.Forms.DialogResult.OK; Case MsgType.YesNoCancel:return Information (msg, "Please select", System.Windows.Forms.MessageBoxButtons.YesNoC Ancel, 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.Xt Ramessagebox.show (text, caption); public static DialogResult Show (string text, string caption, MessageBoxButtons buttons) {retur n 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, Mess Ageboxicon 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) {RE Turn DevExpress.XtraEditors.XtraMessageBox.Show (owner, text, caption, buttons, icon); } #endregion #region Information public static DialogResult information (String message) { return DevExpress.XtraEditors.XtraMessageBox.Show (Message, "Messages", MessageBoxButtons.OK, MessageBoxIcon.Information) ; public static DialogResult information (string message, string caption) {return Devexpress.xtra Editors.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.xtraedit Ors. Xtramessagebox.show (Message, caption, buttons, messageboxicon.information, Defbutton); } #endregion #region Question public static DialogResult Question (string text) {RE Turn DevExpress.XtraEditors.XtraMessageBox.Show (text, "Doubt", MessageBoxButtons.OK, messageboxicon.question); public static DialogResult Question (string text, string caption) {return devexpress.xtraeditor S.xtramessagebox.show (text, caption, MessageBoxButtons.OK, messageboxicon.question); } public static DialogResult Question (string text, string caption, MessageBoxButtons buttons) {R Eturn 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, BU Ttons, Messageboxicon.question, Defbutton); } #endregion #region Warning public static DialogResult Warning (string text) {Retu RN DevExpress.XtraEditors.XtraMessageBox.Show (text, "Warning", 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) {RE Turn DevExpress.XtraEditors.XtraMessageBox.Show (text, caption, buttons, messageboxicon.warning); } #endregion #region Exception public static DialogResult Exception (string text) { Return DEVEXPRESS.XTRAEDITORS.XTRAmessagebox.show (text, "Error", MessageBoxButtons.OK, Messageboxicon.error); public static DialogResult Exception (string text, string caption) {return Devexpress.xtraedito Rs. 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
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
DevExpress MessageBox pop-up box bottom class