schangxiang@126.com
2025-09-04 6f6f118881771a70feb186061ebb4ccd03a47e68
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using yunneiWCS.Properties;
 
namespace yunneiWCS.EnumDefine
{
    public partial class messages : Form
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="type">1=成功,2=失败</param>
        /// <param name="text">提示内容</param>
        public messages(int type, string text)
        {
            InitializeComponent();
            this.Location = new Point(Screen.GetWorkingArea(this).Width / 2 - this.Width / 2, 50);
            if (type == 1)
            {
                this.BackColor = Color.FromArgb(240, 249, 235);
                label1.ForeColor = Color.FromArgb(103, 194, 109);
                pictureBox1.Image = Resources.正确;
                label1.Text = text;
            }
            else
            {
                this.BackColor = Color.FromArgb(254, 240, 240);
                label1.ForeColor = Color.FromArgb(245, 108, 108);
                pictureBox1.Image = Resources.错误;
                label1.Text = text;
            }
        }
 
        private void timer1_Tick(object sender, EventArgs e)
        {
 
            timer1.Enabled = false;
            for (int i = 0; i <= this.Height; i++)
            {
                Point p = new Point(this.Location.X, Location.Y - i);
                this.PointToScreen(p);
                this.Location = p;
                System.Threading.Thread.Sleep(10);
            }
            this.Close();
        }
    }
}