R
ringhio
I wrote a small program for primary school children.
Now I want to add a pause before changing the color of a label control
and I decided to use Sleep.
I was having a lot of problems so I decided to simplify the code.
Now I have a keypress event on a form with the following code:
labNote.ForeColor = Color.Green
System.Threading.Thread.Sleep(2000)
labNote.ForeColor = Color.Red
I dont' know why but the code doesn't work: I don't have the sequence
green-sleep-red but i have green-red-sleep.
Where is the problem? I'm putting to sleep the wrong thread? I didn't
create any thread but...
I really don't understand.
Now I want to add a pause before changing the color of a label control
and I decided to use Sleep.
I was having a lot of problems so I decided to simplify the code.
Now I have a keypress event on a form with the following code:
labNote.ForeColor = Color.Green
System.Threading.Thread.Sleep(2000)
labNote.ForeColor = Color.Red
I dont' know why but the code doesn't work: I don't have the sequence
green-sleep-red but i have green-red-sleep.
Where is the problem? I'm putting to sleep the wrong thread? I didn't
create any thread but...
I really don't understand.