Home > Net >  Winfrom - while loop problem
Winfrom - while loop problem

Time:09-17



Such as the global variables a, b, c
Click on the button, to judge if it is a 0, just waiting for a 1, code continues to go down
The main thread that card dead, multithreading tried under fixed

Global variables in class, and can put into 1 0 assignment from other places

CodePudding user response:

Will not work in the main thread, UI interface card death directly, you can't do other operations, you need to do something, may be in another way, another way of thinking

CodePudding user response:

With version should support the async syntax, changed asynchronous is now very simple

Button1_Click method price in front of the async prefix

The content inside all add into await

Await Task. Run (()=& gt; {

Int a=1;
.
.
//the way you before

});

CodePudding user response:

Quote: refer to the second floor HZTLTGG response:


Thanks, got it, problems in the afternoon

CodePudding user response:

I knew I should strive in reference 3 floor response:
Quote: refer to the second floor HZTLTGG response:


Thanks, got it, the problem of an afternoon of


Very good this, learned

CodePudding user response:

If this how how I so so, if he is not so I have been waiting for him is like that...


Object-oriented design is that if this would help me, so as to what on earth is that I tell you

CodePudding user response:

The
reference 5 floor nan peony reply:
if this how how I so so, if he is not so I have been waiting for him is like that...


Object-oriented design is that if this would help me in that way, so as to what on earth is that I tell you
wait a day
  •  Tags:  
  • C#
  • Related