12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- 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;
- }
- }
- }
|