ProgressDialogShow is not showing

Shay

Well-Known Member
Licensed User
Longtime User
Hi

I am using the following, and it does not show the message
the 2 subs inside takes 4 sec, so I should have seen something

ifi put break, I can see the message

ProgressDialogShow("Please wait")
Read_Settings
Read_Logs
ProgressDialogHide
 

Omar

Member
Licensed User
Longtime User
Hello Shay,

It's probably executing the code quicker than you expected ( are your sure it takes 4 sec to execute) and this is why the dialog is probably being hidden immediately.




Hi

I am using the following, and it does not show the message
the 2 subs inside takes 4 sec, so I should have seen something

ifi put break, I can see the message

ProgressDialogShow("Please wait")
Read_Settings
Read_Logs
ProgressDialogHide
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
Try this code:
ProgressDialogShow("Please wait")
DoEvents
Read_Settings
DoEvents
Read_Logs
DoEvents
ProgressDialogHide
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
I gave simple example
what happens if i have many commands after the "show"
do I need to put doevents after each line - it is 100+ lines
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It'll be a trade off between how often you want the Progress to update and how much you want to slow down the actual process.

I would think updating the progress bar every second is enough, so experiment with the placement, although the results will probably be different with different devices.
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
any other solution for "sand clock" when I don't know how much
time task can take, and I want to show something meanwhile

thanks
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
If the process that is taking a long time has no other UI updates, you could run it in a separate thread, the progress bar will then keep running in the main thread. Or you could look at the RunOnGuiThread if there are some UI updates (not tried that though).
 

Attachments

  • ttest.zip
    6 KB · Views: 463
Last edited:
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
I have tried to call DoEvents inside a timer but had no joy with it - even when setting the timer interval as low as 1ms (went to max 1000ms). Placed some DoEvents calls inside some of the nested for/next loops inside my code and could then see the ProgressDialog....Thought that by using a timer the UI related massages (in this case the ProgressDialog) would have had sufficient time to update- especially with the interval set to 1000ms?
 
Upvote 0
Top