Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

How to block a class from being inherited further?

893


What is as keyword in c#?

967


Can we inherit two classes in c#?

937


What is the difference between ienumerable and enumerable?

893


Explain about ODP.net

1214


Define constructor in c#.

891


What is pure abstract class in c#?

889


Can you use foreach iteration on arrays in c#?

1052


What are the steps to create a webservice and consume it?

910


What is difference between dynamic and var in c#?

920


What is a trace and asset? Explain some differences?

1231


I want to print "Hello" even before main() is executed. How will you achieve that?

890


What is the meaning of MSIL?

1230


What is action in c# 3.5?

953


What is the main method in c#?

1049