View Single Post
  #2 (permalink)  
Old 07-01-2006, 10:44 AM
Void's Avatar   
Void Void is offline
Programming Expert
 
Join Date: Jun 2006
Posts: 411
Credits: 0
Rep Power: 12
Void is on a distinguished road
Default

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!
__________________
Void
Reply With Quote