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
What is mvc in c#?
What is Dependency of Injection?
What do you mean by shared assembly?
What is the main usage of keyword “virtual†? How does it work for a method or property?
Explain clr in brief.
What is difference between c and c sharp?
What are delegates?
What is a Command Object in C#?
How can I get the ascii code for a character in c#?
what are implementation inheritance and interface inheritance?
What is an ienumerable in c#?
What is the difference between func and action delegate?
Which of the following operations can you not perform on an ado.net dataset?
What framework is used for performance testing/load testing?
if you do have a stack overflow profile.what is your ranking?