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 remote data?
Should I make my destructor virtual?
Can I define my own exceptions?
What is console readkey in vb net?
What is default value of bool in c#?
Why are local variables stored in stack?
What is extended class in c#?
How do you serialize in c#?
What's the difference between System.String and System..StringBuilder in C#?
What debugging tools come with the .NET ssSDK?
What is the advantage of constructor?
What is #region in c#?
How to find Percentage, name ,College from a resume or document ? How to export these values to other page in C#?
What are the different approaches of passing parameters to a method?
Why do we use stringbuilder in c#?