using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using Stone.Common.WinModule; namespace Stone.Common { public class MyMessageBox { public static void ShowErrorMessage(string MessageInfo) { MessageBox.Show(MessageInfo, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } public static void ShowInfoMessage(string MessageInfo) { MessageBox.Show(MessageInfo, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } public static bool ShowQuestion(string MessageInfo) { bool result = false; if (MessageBox.Show(MessageInfo, "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { result = true; } return result; } public static bool ShowQuestion(string MessageInfo, MessageBoxDefaultButton DefaultButton) { bool result = false; if (MessageBox.Show(MessageInfo, "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, DefaultButton) == DialogResult.Yes) { result = true; } return result; } public static void ShowMessagePop(string MessageInfo, int timer) { frmMessagePop frm = new frmMessagePop(); frm.TimerCount = timer; frm.lblMsg.Text = MessageInfo; frm.Show(); } public static void ShowMessagePop(string MessageInfo) { int timer = 5; frmMessagePop frm = new frmMessagePop(); frm.TimerCount = timer; frm.lblMsg.Text = MessageInfo; frm.Show(); } public static bool ShowQuestionPop(string MessageInfo) { bool result = false; frmMessageQuestion frm = new frmMessageQuestion(); if (frm.ShowQuestion(MessageInfo) == DialogResult.OK) { result = true; } return result; } } }