Lazarus
Programming => General => Topic started by: kinu on October 18, 2021, 02:40:45 pm
-
Hello!
In my main form OnShow I execute a long query, so I want to show a dialog with a progress bar or maybe only a label "Loading...." while executing the query.
So I put in my FormShow procedure something like this:
FormProgress.Show;
MyQuery;
FormProgress.Hide;
And it shows an empty form. No label, nothing, just white background. FormProgress is created in application initialization. If I don't hide the form, it shows the 'Loading...' label when query is completed and main form is showed. Why?
-
Messages aren't processed. If query doesn't allow some sort of progress event, that would allow you to execute Application.ProcessMessages, then only option - is to execute query in another thread.
-
Messages aren't processed. If query doesn't allow some sort of progress event, that would allow you to execute Application.ProcessMessages, then only option - is to execute query in another thread.
Ok, I will try. If it doesn't work, I'll learn the thread thing to get it working. Thank you very much!
EDIT: Well, Application.ProcessMessages in AfterScroll event worked fine!!!!!