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

Can we return two values from a function?

12 Answers   MD Synergy,


what is meant inheritance. can you exaplain what kind inhertance ussed in your project

1 Answers  


What is function and method in c#?

0 Answers  


What is the delegates in c#?

0 Answers  


Explain the functionalities of satellite assembly?

0 Answers   Siebel,






What is threading in c# with example?

0 Answers  


What is continue in c#?

0 Answers  


Which class does the remote object has to inherit?

0 Answers  


What is the difference between internal and protected in c#?

0 Answers  


What are the string functions in c#?

0 Answers  


What is a singleton unity?

0 Answers  


Why is main static in c#?

0 Answers  


Categories