Home TTask in Delphi 10.2
Reply: 0

TTask in Delphi 10.2

user816 Published in April 26, 2018, 5:10 pm

not used TTask before and its a simple thing im trying to do.

While the main form executes a procedure (DoAnalyse) id like to display the TActivityIndicator on my main form without it slowing as the thread does the work. I used to use a progress bar but would prefer to use the more modern Activity Indicator.

I Have tried it two ways:

A simple:



Task := TTask.Create( procedure begin DoAnalyse; end); Task.Start;

it executes perfectly and my activity indicator behaves smoothly.

Problem is when the procedure is finished the main form is locked and doesn't respond at all. im guessing I have to put some kind of call back to the main thread but cant find out how to do it.

Any ideas?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.258341 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO