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


Please Help Members By Posting Answers For Below Questions

What is mvc in c#?

463


Which language is used for desktop application?

486


If I want to override a method one of class A and in class b then how do you declare?

746


how dot net compiled code will become platform independent?

529


What is the default boolean value in c#?

511






What is the difference between hashtable and dictionary in c#?

478


What are the advantages of interface in c#?

504


What are the extension methods in c#?

498


Which is better javascript or c#?

505


What is the use of tryparse in c#?

466


What are partial types in c#?

491


How do you pronounce c#?

501


What is string method in c#?

498


Can a struct be null?

494


Define an escape sequence, name few strings in escape sequence?

479