I have Two Project in one Solution.
I am trying to use Type.GetType("s tring") 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.form 1
from my MWDNav exe. But then I try to Get the Type of MWDBilling.form 1
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(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
addTabPage(Type .GetType("MWDBi lling.Form1"))
End Sub
This Sub works
Private Sub MDIMain_Load(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
addTabPage(Type .GetType("MWDNa v.Form1"))
End Sub
Public Sub addTabPage(ByVa l myType As Type)
Dim myForm As Object = System.Activato r.CreateInstanc e(myType)
i_Filler_tc.Act iveLeaf.TabPage s.Add(New TabPage("Main", CType(myForm,
Control)))
End Sub
This works
Private Sub MDIMain_Load(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim test as new MWDBilling.form 1
Test.show
End Sub
I am trying to use Type.GetType("s tring") 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.form 1
from my MWDNav exe. But then I try to Get the Type of MWDBilling.form 1
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(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
addTabPage(Type .GetType("MWDBi lling.Form1"))
End Sub
This Sub works
Private Sub MDIMain_Load(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
addTabPage(Type .GetType("MWDNa v.Form1"))
End Sub
Public Sub addTabPage(ByVa l myType As Type)
Dim myForm As Object = System.Activato r.CreateInstanc e(myType)
i_Filler_tc.Act iveLeaf.TabPage s.Add(New TabPage("Main", CType(myForm,
Control)))
End Sub
This works
Private Sub MDIMain_Load(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim test as new MWDBilling.form 1
Test.show
End Sub
Comment