SetCheck.cs 958 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Drawing;
  3. using System.Threading;
  4. using System.Windows.Forms;
  5. namespace UAS_MES_NEW.PublicForm
  6. {
  7. public partial class SetCheck : Form
  8. {
  9. Color colors;
  10. string t;
  11. public SetCheck()
  12. {
  13. InitializeComponent();
  14. }
  15. public SetCheck(string Title, Color color)
  16. {
  17. InitializeComponent();
  18. CheckForIllegalCrossThreadCalls = false;
  19. Text = Title;
  20. colors = color;
  21. }
  22. private void SetLoadingWindow_Load(object sender, EventArgs e)
  23. {
  24. label1.Text = Text;
  25. label1.ForeColor = colors;
  26. //在本窗体新建一个进程用来判断传递的进程是否执行结束
  27. Thread t1 = new Thread(SetLoadFinish);
  28. t1.Start();
  29. }
  30. private void SetLoadFinish()
  31. {
  32. Thread.Sleep(200);
  33. Close();
  34. }
  35. }
  36. }