Cross-container component connection in Windows Form Designer
Component X with property P of type component Y.
If I drop component X and component Y on form F, when I am in the property browser for component X and click on property P, a drop down list box allows me to choose the instance of component Y on form F to assign to property P. Excellent ! This is what design-time RAD programming is all about.
Now let's suppose I want to put component Y, in a separate form G, as a public component, and remove component Y from form F. Now when I click property P of component X in Form F, there is no entry in the drop down list box for the property that lets me choose component Y on form G.
Is there some way I can get the visual studio designer to see form G from form F so that the connection between component X on form F and component Y on form G can be made at design time ?
I have tried, in a C++/CLI Windows Form application, adding form G's header file to form F, but this does nothing to solve the problem. Yet I suspect there must be some way to do this.
Lest you think this cross-form connection is a bit odd, let's look at a possibly more popular situation of cross-container connection, where the programmer at design time adds a component class to his project, drops a number of components into the component class using the class designer, makes the dropped components public, configures the components, and then uses the component class as a kind of data container for those components. In our example above component Y is one of those components. Now the programmer wants to reuse his data container component class in the current project and in other projects, by being able to drop component X on a form he designs, and connect it to the component Y in his component class container.
I sense that there must be some way to connect components across containers in the Visual Studio Designer but I can not determine how to do it. Any help what be appreciated.