啊鑫
2024-07-11 afbf8700d137710713db61955879d0f5acb73738
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#region
 
using System;
using System.Windows.Forms;
 
#endregion
 
namespace CSFrameworkV5.Library.UIForm
{
    public partial class MsgEx : frmBaseUI
    {
        private DialogResult _Result = DialogResult.OK;
 
        private MsgEx()
        {
            InitializeComponent();
        }
 
        private void btnCancel_Click(object sender, EventArgs e)
        {
            _Result = DialogResult.Cancel;
            Close();
        }
 
        private void btnOK_Click(object sender, EventArgs e)
        {
            _Result = DialogResult.OK;
            Close();
        }
 
        public static void ShowError(string msg, string title = "错误消息")
        {
            var form = new MsgEx();
            form.lblMsg.Text = msg;
            form.Text = title;
            form.TitleText = title;
            form.pic.Image = form.picERR.Image; //图片
            form.ShowDialog();
        }
 
        public static void ShowInformation(string msg, string title = "普通消息")
        {
            var form = new MsgEx();
            form.lblMsg.Text = msg;
            form.Text = title;
            form.TitleText = title;
            form.pic.Image = form.picInfo.Image; //图片
            form.ShowDialog();
        }
 
        public static bool ShowQuestion(string msg, string title = "对话框")
        {
            var form = new MsgEx();
            form.lblMsg.Text = msg;
            form.Text = title;
            form.TitleText = title;
            form.pic.Image = form.picQue.Image; //图片
            form.ShowDialog();
            return form._Result == DialogResult.OK;
        }
 
        public static void ShowWaring(string msg, string title = "系统警告")
        {
            var form = new MsgEx();
            form.lblMsg.Text = msg;
            form.Text = title;
            form.TitleText = title;
            form.pic.Image = form.picWar.Image; //图片
            form.ShowDialog();
        }
    }
}