using GcDevicePc.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GcDevicePc
{
    public partial class TestForm : Form
    {
        public TestForm()
        {
            InitializeComponent();
            bgWorker.DoWork += BgWorker_DoWork;
            bgWorker.RunWorkerCompleted += BgWorker_RunWorkerCompleted;
        }

        BackgroundWorker bgWorker = new BackgroundWorker();
        PrompBox loadingCtl = new PrompBox(162, true);//定义加载控件
        private void BgWorker_DoWork(object sender, DoWorkEventArgs e)
        {

            System.Threading.Thread.Sleep(3000);

        }

        private void BgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            loadingCtl.Hide();

        }
        private void btnShow_Click(object sender, EventArgs e)
        {
            loadingCtl.TipsInfo = "提示信息";
            //显示加载动画
            loadingCtl.ShowLoading(this);
            Application.DoEvents();
            bgWorker.RunWorkerAsync();

        }

        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show("asd");
        }
    }
}
