using System; using System.Drawing; using System.Threading; using System.Windows.Forms; namespace UAS_MES_NEW.PublicForm { public partial class SetCheck : Form { Color colors; string t; public SetCheck() { InitializeComponent(); } public SetCheck(string Title, Color color) { InitializeComponent(); CheckForIllegalCrossThreadCalls = false; Text = Title; colors = color; } private void SetLoadingWindow_Load(object sender, EventArgs e) { label1.Text = Text; label1.ForeColor = colors; //在本窗体新建一个进程用来判断传递的进程是否执行结束 Thread t1 = new Thread(SetLoadFinish); t1.Start(); } private void SetLoadFinish() { Thread.Sleep(500); Close(); } } }