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 are the types of inheritance in c#?
Is it possible to nest cfml conditional tags?
What is sqlconnection in c#?
Can you store strings in arrays?
How do I start a program in c#?
What is a thread? What is multithreading?
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 a class c#?
Define strong name in c#?
Why static variables are used?
what is scope of a protected internal member variable of a c# class
What is the use of getcommandlineargs() method in c#.net?
What are c# i/o classes? What are the commonly used i/o classes?
What is data type c#?
What is xamarin used for?