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 the difference between abstract and abstraction?

0 Answers  


There were a lot of questions asked, so I will list the topic (and add a what is "topic" and know pros/cons). Extreme programming, what is a transaction, various SDLC design approaches, what is a namespace, define a good test case, what is a stored proc, webservice? design patterns? linker? compiler? access modifiers? stack vs. queue? arrays vs. linked lists? sorting algorithms? recursion? OOP principles?

0 Answers   Avanade,


what is the purpose of new keyword while creating an object?

3 Answers  


What is .cshtml file?

0 Answers  


What is the difference between overriding and overloading in systemverilog?

0 Answers  


What will a loop recorder show?

0 Answers  


What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?

3 Answers  


What is the diff between the System.Array.CopyTo() and System.Array.Clone()?

0 Answers   Siebel,


Is c# a strongly-typed language?

0 Answers  


What is private readonly in c#?

0 Answers  


This is Kishore i am MCA graduate i have percentage less(52%) in my 10th still i completed .NET course any body tell me how to put fake experience with my BSC degree if you do not mind tell me some fake certificates giving consultencies names in Chennai,Bangalore

5 Answers  


How long does it take to learn c# for unity?

0 Answers  


Categories