{$R *. DFM} Procedure TForm1. Threadtest (strtest: string); The begin Showmessage (strtest); end; Procedure TForm1. Button1Click (Sender: TObject); The begin Threadtest (" STR "); end;
Procedure TForm1. Button2Click (Sender: TObject); Var I: Integer; The begin For I=0 to ProgressBar1. Max do The begin Label1. Caption:='in the operation of the main thread; ProgressBar1. Position:=I; Application. ProcessMessages; end; end;
Procedure TForm1. FormCreate (Sender: TObject); The begin Progressbar1. Max:=1000000; end;
End.
CodePudding user response:
Great god genuflect is begged for help, this problem is very entanglements,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
CodePudding user response:
Beginners Delphi, true don't know how to modify,,,
CodePudding user response:
upupupupup
CodePudding user response:
This is a question worth thinking about,,,,
CodePudding user response:
How does not seem to understand
CodePudding user response:
The first way is to join the thread class destructor, limitations, suitable to create a thread not hung thread immediately get your parameters passed to the normal operation, the second is the thread class publish domain to add the property, use, create a thread object, the parameters into the into the property, its tip: don't make the hanging thread to thread synchronization, synchronization technology should be used to synchronize threads,