|
Re: Visual C++ 2005 Forms
Create a new class that extends from the standard Windows form class.
Add class variables for variables you want to pass in from the calling form.
Now you need to copy the variable from the calling form into your new form class.
You can do this a number of ways: overload the show method (or any other method, or create a new one) to include parameters for all the variables you want to share, and in that method copy the parameters into the class variable.
Or add a constructor to your new form object where you can pass in the varilables you want to share as parameters, and again copy the parameters into the class variable.
Sorry, no code to show you. Just make sure you don't run into synchronization problems with the calling forms shared variables. Cases like this usually call for a modal form so that the calling form execution is blocked until the new form returns.
|