Delphi 7: How to implement multi-threading?

前端 未结 2 2209
清酒与你
清酒与你 2021-02-11 03:35

I have a TButton in the main TForm. When user click the button, it will execute the below process:

begin
  Process_done := FALSE;

  Process_Result.Clear;

  cmd         


        
2条回答
  •  萌比男神i
    2021-02-11 03:57

    You should create a class inherited from TThread and put that code in there. I don't remember exactly, but I think you'll find TThread template in File->New dialog box. When code execution is finished, you just notify your gui. Here's an article how to synchronize UI with external thread http://delphi.about.com/od/kbthread/a/thread-gui.htm

提交回复
热议问题