I have this silly C# code on a buttonClick (WPF) handler and i wonder why the text box shows only the last value(=0) and no the previous values(9-1) . When I tested the code to a console application I saw all values in the command line.(I am beginner to C#,WPF)
Thnx
private void clock_Click(object sender, RoutedEventArgs e)
{
DateTime clicktime = DateTime.Now;
int nextsecont = DateTime.Now.Second + 1;
int now = clicktime.Second;
int timer = 10;
do
{
if (nextsecont == DateTime.Now.Second)
{
now++;
timer--;
nextsecont++;
textbox3.Text = timer.ToString();
}
} while (nextsecont <= (clicktime.Second + 10));
}
PS: I know there are better ways to do that (f.e. to use timer) but this is not the point. Sorry for my english..
Explanation: now i see the initial value for 10 seconds and then i see the 0. I don't see intermediate values..