Thanks BK that's exactly the kind of thing I was looking for! Just one Q
.....
Having explored the assembly object for a while I still can't figure out how
to find out through code the "Container" value you need in the LoadFrom
method. For example, the Container value has a value of "XXX.exe" but the
"FullName" needs a value of "XXX.Form1". I'm sure the GetExecutingAssembly
method will prove useful but I'm struggling to pick out the correct way to
do this.
E.g. Let's say you have an class that is responsible for delivering form
objects (dressed up with nice titles and styles etc) based on a string value
equal to the form object name supplied to the constructor. This class could
be called from anywhere in the solution.
Thanks in advance,
Paul
"BK" <bk******@hotmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
One way is through reflection:
Dim ExternalAssembly As System.Reflection.Assembly = _
System.Reflection.Assembly.LoadFrom(Container)
Dim CalledForm As Form = _
ExternalAssembly.CreateInstance(FullName, True)
CalledForm.FriendlyFormName = FullName
CalledForm.Show()
Where:
Container is the name of the executable or dll containing the form (eg.
"MyApp.Exe")
FullName is the qualified name of the form (eg "MyApp.Form1")
HTH