using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace demo.UI { public delegate void SartEventsend(ushort Times); public partial class Form_startProgress : Form { public Form_startProgress() { InitializeComponent(); } private ushort times = 0; private void Acttimes(ushort Times) { if (this.InvokeRequired) { SartEventsend g = new SartEventsend(Acttimes); g.Invoke(Times); } else { progressBar_start.Value = Times; } } private void timer1_Tick(object sender, EventArgs e) { if (times <= 10) times++; if (GlobalVariable._StartProcessStatus.loadForm) { times = 99; } if (GlobalVariable._StartProcessStatus.deleteBuffer) { if (times <= 40) times++; } if (GlobalVariable._StartProcessStatus.startPlatform) { if (times <= 80) times++; } Acttimes(times); if (times >= 99) { progressBar_start.Visible = false; timer1.Enabled = false; GlobalVariable._StartProcessStatus.startPlatform = false; GlobalVariable._StartProcessStatus.loadForm = false; this.Close(); } } private void Form_startProgress_Load(object sender, EventArgs e) { timer1.Interval = 1; timer1.Enabled = true; } } }