I have a progress window, that I create and show when I have a long running process in my apps.
I’ve tried to use threads and timers, and avoid doevents like mentionned on this forum…
but.
my progress window is never shown unless I call doevents when I send new progress bar value from the main long running method
the UserInterfaceUpdate of the thread is called the right number of times, I update the value of the progressbar there, but the progress window (and the bar) doesn’t get updated
what can it come from ?
the window is a movable modal type.
doesn’t change anything.
the windows is updated at start, but nothing happens until the method finishes and the window is closed …
I tried to put a label at the bottom left of the window, with the value of the progress, and nothing is displayed !
although if I break with the debugger, the label.text gets updated in code…
seems the window is frozen ?
may be some hint: it kind of worked with 2019r11, but it does not works anymore with 2022r41…
well after some(!) searches, it seems the progress bar does not get refreshed…
if I display the progress bar value as a text label , it is shown and updated correctly…
and the progress bar is not updated accordingly…
if I change the progressbar to a desktopprogressbar, and call Refresh(true) it is still not updated as it should…
small gif of the updating process …
the number bottom left ( correctly updated) is the value that is stored in the progress bar… which doesn’t move at all…
at 10 sec, a timer showing the remaining time appears correctly at the bottom right.
10 years ago, I followed this path for an Import Text to SQLite with lots of test / Replace(s)…
Then, I created my own Progress window with a nice green feeded rectangle.
So many work for a single use (it was the archive / actual data). But I was finalizing the project and do not realize this will never be seen by any user, only by me.
if windows ignore a permanet refresh because it is to often you can compare the time from last to current progress and update the ui as example each second.
what i used in vb6 if there is a for next i update only if (i mod 1000)=0 ← or something like that.