123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System;
- using System.Threading;
- using System.Windows.Forms;
- namespace UAS_MES_NEW.PublicForm
- {
- public partial class SetLoadingWindow : CustomControl.BaseForm.BaseForm
- {
- Thread LoadingThread;
- public SetLoadingWindow()
- {
- InitializeComponent();
- }
- public SetLoadingWindow(Thread LoadEvent,string Title)
- {
- InitializeComponent();
- LoadingThread = LoadEvent;
- Text = Title;
- }
- private void SetLoadingWindow_Load(object sender, EventArgs e)
- {
-
- loadingCircle1.OuterCircleRadius = 20;
- loadingCircle1.InnerCircleRadius = 12;
- loadingCircle1.Active = true;
- LoadingThread.Start();
-
- Thread t1 = new Thread(SetLoadFinish);
- t1.Start();
- }
- private void SetLoadFinish()
- {
- try
- {
- while (LoadingThread.IsAlive)
- {
- }
- Close();
- }
- catch (Exception)
- {
- return;
- }
- }
-
-
- private void SetLoadingWindow_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (LoadingThread.IsAlive) {
- e.Cancel=true;
- }
- }
- }
- }
|