show a form by using a string

  • Thread starter Thread starter arctica82
  • Start date Start date
A

arctica82

Hi,I want to show forms in different applications in a one solution in
VB.Net by useing their names.I mean I want to use their name in a
string format to show them,but I dont know how? :?:
 
Experiment with these:

Dim asm As [Assembly] = [Assembly].LoadFrom("the assembly you want")

Dim frm As Form = Activator.CreateInstance(asm.GetType("the fully
qualified namespace and name of the form))

'now do whatever with the instance of the form
frm.Show()

By the way, those nifty methods can be found in System.Reflection
 
Also, BTW, obviously, if Option Strict is on you'll need to cast the return
value of CreateInstance() to a Form.

CMM said:
Experiment with these:

Dim asm As [Assembly] = [Assembly].LoadFrom("the assembly you want")

Dim frm As Form = Activator.CreateInstance(asm.GetType("the fully
qualified namespace and name of the form))

'now do whatever with the instance of the form
frm.Show()

By the way, those nifty methods can be found in System.Reflection


arctica82 said:
Hi,I want to show forms in different applications in a one solution in
VB.Net by useing their names.I mean I want to use their name in a
string format to show them,but I dont know how? :?:
 
Back
Top