FrmWelcom.cs
2.3 KB
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
73
74
75
76
77
78
79
80
81
82
using Dolen.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using UIControl.Forms;
namespace AGVDispatch
{
public partial class FrmWelcom : FrmBase
{
public bool Loading { get; set; } = true;
ImageList imageList;
FormMain formMain;
public FrmWelcom()
{
InitializeComponent();
label1.Text = $"Copyright © {DateTime.Now.ToString("yyyy")}";
loadImages();
thread = new Thread(loading);
thread.IsBackground = true;
thread.Start();
}
void loadImages()
{
imageList = new ImageList();
imageList.Images.Add(Properties.Resources._1);
imageList.Images.Add(Properties.Resources._2);
imageList.Images.Add(Properties.Resources._3);
imageList.Images.Add(Properties.Resources._4);
imageList.Images.Add(Properties.Resources._5);
imageList.Images.Add(Properties.Resources._6);
imageList.Images.Add(Properties.Resources._7);
imageList.Images.Add(Properties.Resources.ok);
}
Thread thread;
private void loading()
{
int idx = 0;
while (!this.IsHandleCreated)
Thread.Sleep(300);
this.Invoke(new Action(() =>
{
formMain = new FormMain("AGV任务调度系统");
})
);
pictureBox1.Invoke(new Action(() =>
{
while (!formMain.IsLoad)
{
pictureBox1.Image = imageList.Images[idx];
idx++;
if (idx == 6)
idx = 0;
Thread.Sleep(300);
}
}));
pictureBox1.Invoke(new Action(() =>
{
pictureBox1.Image = imageList.Images[7];
}));
Thread.Sleep(2000);
this.Invoke(new Action(() =>
{
this.Hide();
formMain.Show();
})
);
}
}
}