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 WMS.Properties;
namespace WMS.EnumDefine
{
public partial class messages : Form
{
///
///
///
/// 1=成功,2=失败
/// 提示内容
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();
}
}
}