Change display delay (in Dumpcontainer) between each step of a loop in real time
I've made a code to solve a kind of puzzle and I want to render the progress in a dumpcontainer (cf capture). It works like a charm and I add a Thread.Sleep(ms) to have time to see it because it was to fast. Now, I'd like to speed down / speed up this progress in real time.
I add two buttons to do that but it seems to have no effects. I think I missed something or I need a trick...Any suggestions ?
Comments
Given that your query is synchronous, you must set the IsMultithreaded property on the buttons to true if you want their click events to fire while the query is still running. Keep in mind that event handlers will fire on separate threads.
Alternatively, make your query asynchronous (async Task Main) and
await Task.Delay
instead ofThread.Sleep
ing.If this doesn't fix it, please post the code for a minimum repro.
That was exactly what I needed
With IsMultithreaded property to true, it works exactly like I want
Thanks a lot Joe