One start and stop button is there and one textbox is
there.when you click start button ,it will display
1,2,3......up to infinite in textbox.when you click stop
button it will stop.
Answer / lince thomas
bool stopBtnClk = false;
bool startBtnClk = false;
private void BtnStart_Click(object sender, EventArgs e)
{
stopBtnClk = false;
startBtnClk = true;
int i = 1;
while (true)
{
textBox1.Text = i.ToString();
i += 1;
Application.DoEvents();
if (stopBtnClk == true)
{
break;
}
}
}
private void BtnStop_Click(object sender, EventArgs e)
{
stopBtnClk = true;
Application.Exit ();
}
Is This Answer Correct ? | 1 Yes | 0 No |
What is lazy in c#?
What is the implicit name of the parameter that gets passed into the set method/property of a class?
Why main is static in c#?
Is clr a compiler?
Explain the three test cases in unit testing?
Overloaded constructor will call default constructor internally?
Why do we need structs in c#?
Can abstract class have constructor?
what is the difference between .dll and .exe
What is distribute by in hive?
Explain manifest in c#.
Does the variables of a private class-level inherited?