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 Posted / 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 |
Post New Answer View All Answers
Is c# the same as d flat?
What is the benefit of dependency injection c#?
Explain the difference between “system.array.clone()” and “system.array.copyto()” in c#?
Is string passed by reference in c#?
Is inheritance possible in c sharp?
Explain the difference between Response.Write () and Response.Output.Write ().
What is ControlBox Propertie
Define satellite assembly in c#?
Explain the serialization in .net
What is the difference between array and arraylist in c#?
Can a static class contain non static members?
What is the property of class?
What is type class in c#?
Where do I put dll files?
What is static variable in c#?