123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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 BEMSDataGateway
- {
- delegate void TestDelegate(string msg);
- delegate void TestDelegate2();
- public partial class Loading_Form : Form
- {
- public Loading_Form()
- {
- InitializeComponent();
- System.Threading.Thread thread = new System.Threading.Thread(Thread1);
- thread.Start();
- }
- private void Loading_Form_Load(object sender, EventArgs e)
- {
- }
- private void showText(string msg)
- {
- Loading_Point.Text = msg;
- }
- private void Thread1()
- {
- for(int i=0; i < 101; i++)
- {
-
-
-
-
-
-
-
-
-
- ForceToCreateHandle();
- this.Invoke(new TestDelegate(showText), i.ToString());
- System.Threading.Thread.Sleep(20);
- }
- this.Invoke(new TestDelegate2(Close));
- }
- private void ForceToCreateHandle()
- {
- IntPtr x;
- if (!this.IsHandleCreated)
- x = this.Handle;
- }
- }
- }
|