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 the namespcae generally given to the webpage of the .NET Framework ?
Why do we use polymorphism in c#?
What is icomparable in c#?
What are the advantages of using delegates in c#?
Why is main static in c#?
What are c# collections?
What is int64 in c#?
How do you implement thread synchronization in c#?
how to compare numbers and dispaly the largest ? *first thing I wanted to do is to input how many numbers to be compared *and then analyzed the largest then display it.
What is reference c#?
Does a loop recorder have to be removed?
When should we use sealed class in c#?
Is c# difficult to learn?
How big is a float?
Explain the various types of classes used in c#?