我们经常操作messagebox类,有时候我们又分不清一些参数,下面是一些操作messageBox的常用方法:
public static class ClsMsg { public static void ShowInfoMsg(string p_info) { MessageBox.Show(p_info, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } public static void ShowWaringMsg(string p_info) { MessageBox.Show(p_info, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } public static DialogResult ShowYesNoMsg(string p_info) { return MessageBox.Show(p_info, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question); } public static DialogResult ShowOKCancelMsg(string p_info) { return MessageBox.Show(p_info, "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); } public static void ShowErrorMsg(string p_info) { MessageBox.Show(p_info, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
喜欢的话可以优化下,用用