JamesAnthony
asked on
Dim a Form
Hi all
Have this code
Dim NewMDIChild As New MyWorkingForm
NewMDIChild.MdiParent = AMPSMDI2010
NewMDIChild.Show()
Where myWorkingform is a form in my project and it works
BUT
I want to do this, should be simple but getting lost
Dim gForm As New Form
gForm = "MyworkingForm"
(Where the "MyWorkingForm" is a passes String rather that a form in the project)
Dim NewMDIChild As New gform
NewMDIChild.MdiParent = AMPSMDI2010
NewMDIChild.Show()
Have this code
Dim NewMDIChild As New MyWorkingForm
NewMDIChild.MdiParent = AMPSMDI2010
NewMDIChild.Show()
Where myWorkingform is a form in my project and it works
BUT
I want to do this, should be simple but getting lost
Dim gForm As New Form
gForm = "MyworkingForm"
(Where the "MyWorkingForm" is a passes String rather that a form in the project)
Dim NewMDIChild As New gform
NewMDIChild.MdiParent = AMPSMDI2010
NewMDIChild.Show()
in VB 2008 you can just call the form directly from another form.
with gform
.mdiparent=AMPSMDI2010
.show
end with
with gform
.mdiparent=AMPSMDI2010
.show
end with
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use reflection to create the instance of form from its name
http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/vb-net-creating-an-instance-of-a-class-u
http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/vb-net-creating-an-instance-of-a-class-u
ASKER
Got me on the right road, wasn't the complete solution,
But
Thanks
But
Thanks
Open in new window