koteswara rao
Member
- Joined
- Feb 1, 2022
- Messages
- 12
- Programming Experience
- 3-5
Hi all, Thanks in advance
I am running one thread from start button click. that thread is in the while loop .I am trying to give the break for the while loop in the Abort Button click. but its not giving the break please help me in this task.
run the code from start click
I am running one thread from start button click. that thread is in the while loop .I am trying to give the break for the while loop in the Abort Button click. but its not giving the break please help me in this task.
run the code from start click
Startclick:
ThreadForStartTest = new Thread(new ThreadStart(Method_containingwithWhileLoop));
ThreadForStartTest.IsBackground = true;
ThreadForStartTest.Start();
TmrForFullTest.Start();
Abort Button click:
private void Cntrl_BtnAbort_Click(object sender, EventArgs e)
{
if (ThreadForStartTest != null && ThreadForStartTest.IsAlive)
{
try
{
ThreadForStartTest.Join(100);
FlagforAbortClicked = true;
}
catch (Exception ex)
{
}
}
}