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 mvc in c#?
Which language is used for desktop application?
If I want to override a method one of class A and in class b then how do you declare?
how dot net compiled code will become platform independent?
What is the default boolean value in c#?
What is the difference between hashtable and dictionary in c#?
What are the advantages of interface in c#?
What are the extension methods in c#?
Which is better javascript or c#?
What is the use of tryparse in c#?
What are partial types in c#?
How do you pronounce c#?
What is string method in c#?
Can a struct be null?
Define an escape sequence, name few strings in escape sequence?