c# - Thread.Sleep or Timer for showing every step -


i making game wumpus world in winforms in agent(computer) can move in 4 directions. using button control base , showing , hiding images ever needed. used thread.sleep problem when click button nothing showing on form. process on background working fine not showing each step. , yes using thread.sleep in current ui thread.
i want show every step users interval of 2 seconds.

it's hard answer without code go by, main problem understand change of world, , tell sleep, witch means nothing painted. , when thread wakes up, again change world , make sleep. nothing painted way.

better way timer, make single timer , queue of events needed shown , on way it.

are working on winforms, because if working on wpf can nicer things

edit: i'm not saying timer best way it, it's valid way


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -