| |

VerySource

 Forgot password?
 Register
Search
View: 705|Reply: 4

MDI child form System.Threading.Thread.Sleep will make the entire main form peel, how to solve

[Copy link]

4

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-2 21:30:01
| Show all posts |Read mode
I just want to make a child form spleep without affecting the parent
Reply

Use magic Report

0

Threads

110

Posts

63.00

Credits

Newbie

Rank: 1

Credits
63.00

 China

Post time: 2020-1-3 00:39:01
| Show all posts
try ..

Application.DoEvents ();
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-4 09:00:01
| Show all posts
It seems to be the same thread, this is more troublesome!
Reply

Use magic Report

4

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-1-18 14:18:02
| Show all posts
Like it yourself
Reply

Use magic Report

0

Threads

15

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-19 19:45:01
| Show all posts
You can write a delay method, such as this
  #region delay (in seconds)
        public void Delay (int delayTime)
        {
            DateTime now = DateTime.Now;
            int s;
            do
            {
                TimeSpan spand = DateTime.Now-now;
                s = spand.Seconds;
                Application.DoEvents ();
            }
            while (s <delayTime);
        }
        #endregion
This will not wait like a crash during the delay
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list