I have a code like this in windows form , c++
private: System::Void button3_MouseUp(Object^ sender, MouseEventArgs^ e) {
_run=false;
}
private: System::Void button3_MouseDown(Object^ sender, MouseEventArgs^ e) {
_run = true;
MyAction();
}
private: System::Void MyAction()
{
while(_run)
{
i=i+1;
System::Console::WriteLine( i );
}
}
The motivation was to keep the value of "i" (i is an integer ) going up till the time I press the the button and stoping when I release the button . But one i press the button , value of i increses and the UI hangs and never stops , Any one have any suggession to solve this issue