You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

73 lines
2.2 KiB

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;
}
}
}