Delphi 10.4 FMX (although I’m sure this is a general Delphi question)
My dialog window is reading a large file.
while not EOF(theFile) and not CancelButtonPressed do
Label1.Text := theLine;
ProgressBar1.Value := PercentageOfFileRead;
Without the Application.ProcessMessages, the Label and ProgressBar are never painted. I don’t think Application.ProcessMessages is the best way to go though as it tends to crash after a few thousand calls.
What is the best practice for repainting components during a batch process like this?