I would like to show a ProgressWheel, just like a cursor wait after the user pressed “Search” to load records and populate to a ListBox (usually takes 10 seconds to load due to complex SQL), I tried to make it simple:
ProgressWheel.visible = true
LoadRecords //load and populate
ProgressWheel.visible = false
It doesn’t seem to work, the ProgressWheel doesn’t show at all. Then I searched through the web and doc, I should use Timer and Thread to do so.
- Thread does not allow on WebDialog
- Update UI (populate records to ListBox) is not suggested in Thread.Run
Can someone explain again how this can be done? The effect like submitting a post in this forum, screen freezed with a ProgressWheel appears until it is done is perfect to me. Thanks in advance.
This is one solution. In the action event of the search button, show the progresswheel and then start a one time timer. in the timer action, run the sql and hide the progresswheel.
This limitation applies only to Desktop. In Web, you can update the UI from a thread.
I have the same problem. Question - why is it necessary to perform the SQL in the timer?
Show the ProgressWheel in the button MouseDown instead.
Thanks Brandon, it works.
i have the same issue
i want to populate a weblistbox with a random generated array, for some program testing. within the action of a botton, the progresswheel is set visible, and after populating the weblistbox, it is turned off. but the progress wheel never shows.
timer way is also used with a boolean switch which is turn on when the button is called, and turne off when finished, still does not show ever.
thank in advance for your help
ok, it work for me now
i now understand how the timer thing works and in my case
- a button action is call
- the action activates the progresswheel (visible)
- the action sets a switch to on
- at the timer, if the switch is on, a trigger the method
- the switch is set off
- when the method ends the progresswheel is turn invisible
under vb5 or vb6, a doevens would had been enough
is not exactly the cleanest approach
but it worked