Now, you have to handle the callbacks in the parent form
Code:
////////////////////////////////////////////////////////////
// Override to get messages from child
//////////////////////////////////////////////////////////
public: virtual System::Void WndProc(System::Windows::Forms::Message % message) override
{
try {
switch (message.Msg)
{
// Handle our incoming custom message
case MSG_CHILDTEXT:
{
// This custom message should set the text of the parent's
// main textbox
break;
}
// Start the Timer - Run
case MSG_CHILDPLAY:
{
toolStripButton1_Click(nullptr,nullptr);
break;
}
case MSG_CHILDSTOP:
{
stopBtn_Click(nullptr,nullptr);
break;
}
case MSG_CHILDRESTART:
{
restartBtn_Click(nullptr,nullptr);
break;
}
case MSG_CHILDPAUSE:
{
pauseBtn_Click(nullptr,nullptr);
break;
}
case MSG_CHILDEXIT:
{
myFullTrans->Close();
this->Close();
break;
}
// All other messages should be sent to the default WndProc
// for System::Windows::Forms
default:
{
Form::WndProc (message);
break;
}
} // End Case
}
catch (System::Exception^)
{
MessageBox::Show("Error");
}
}
Change the message code to whatever you like and enjoy!