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.



One start and stop button is there and one textbox is there.when you click start button ,it will di..

Answer / 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

More C Sharp Interview Questions

What is lazy in c#?

0 Answers  


What is the implicit name of the parameter that gets passed into the set method/property of a class?

0 Answers   Siebel,


Why main is static in c#?

0 Answers  


Is clr a compiler?

0 Answers  


Explain the three test cases in unit testing?

0 Answers   Siebel,






Overloaded constructor will call default constructor internally?

0 Answers  


Why do we need structs in c#?

0 Answers  


Can abstract class have constructor?

0 Answers  


what is the difference between .dll and .exe

0 Answers   HCL,


What is distribute by in hive?

0 Answers  


Explain manifest in c#.

0 Answers  


Does the variables of a private class-level inherited?

0 Answers   Siebel,


Categories