M
Mike Walters
I have Two Project in one Solution.
I am trying to use Type.GetType("string") to pass the "Type" to a Sub.
Project one is MWDNav. Project two is MWDBilling. MWDNav is my exe.
MWDBing is a Class Library that holds my forms. I am reference
MWDBilling and I can create a "new" instance of my MWDBilling.form1
from my MWDNav exe. But then I try to Get the Type of MWDBilling.form1
from my MWDNav I get a myTpye Null error. I am looking for any
suggestions.
Thanks
Mike Walters
This Sub does not
Private Sub MDIMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
addTabPage(Type.GetType("MWDBilling.Form1"))
End Sub
This Sub works
Private Sub MDIMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
addTabPage(Type.GetType("MWDNav.Form1"))
End Sub
Public Sub addTabPage(ByVal myType As Type)
Dim myForm As Object = System.Activator.CreateInstance(myType)
i_Filler_tc.ActiveLeaf.TabPages.Add(New TabPage("Main", CType(myForm,
Control)))
End Sub
This works
Private Sub MDIMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim test as new MWDBilling.form1
Test.show
End Sub
I am trying to use Type.GetType("string") to pass the "Type" to a Sub.
Project one is MWDNav. Project two is MWDBilling. MWDNav is my exe.
MWDBing is a Class Library that holds my forms. I am reference
MWDBilling and I can create a "new" instance of my MWDBilling.form1
from my MWDNav exe. But then I try to Get the Type of MWDBilling.form1
from my MWDNav I get a myTpye Null error. I am looking for any
suggestions.
Thanks
Mike Walters
This Sub does not
Private Sub MDIMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
addTabPage(Type.GetType("MWDBilling.Form1"))
End Sub
This Sub works
Private Sub MDIMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
addTabPage(Type.GetType("MWDNav.Form1"))
End Sub
Public Sub addTabPage(ByVal myType As Type)
Dim myForm As Object = System.Activator.CreateInstance(myType)
i_Filler_tc.ActiveLeaf.TabPages.Add(New TabPage("Main", CType(myForm,
Control)))
End Sub
This works
Private Sub MDIMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim test as new MWDBilling.form1
Test.show
End Sub