int myMain(System::Windows::Forms::ListBox^ lstStatus)
{ do
{
// the code that is executed
}while (terminate == false);
}
when i press the start it places terminate on false and executes my code.
when i press stop it places terminate on true but still executes my code,
how do i get out of the thread by using the stop button
Yes, and? It doesn't change the fact that your code is C++/CLI and that almost nobody here knows or does C++/CLI. And actually your question is not about general C++ programming, it is about specific Windows programming and therefore should have been better to post in the Windows forum.
But all aside, if you really want an answer, post your question at the Microsoft MSDN Forums.
Yes, but that's C++/CLI, not C++. This belongs in the Windows forum. Not sure what exactly you're trying to stop, but wouldn't the thread you start in button1_Click be one of the things you'd need to stop?
Your problem is that you declare local variables in lines 12 and 22 and set them to a value. They don't affect the value of the variable checked in line 7 of myMain().