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? :?:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top