Link to home
Start Free TrialLog in
Avatar of rocky050371
rocky050371

asked on

Reflection and Forms

I am using the following code to create a form based on a key value from a toolbar, is this the correct way of doing it. I have stitched it together from various exmaples. My concern starts with the first line is this right

   Dim asm As Assembly = Assembly.GetExecutingAssembly
            Dim formObj As Type = asm.GetType("Aquarius." & e.Item.Key)
            Dim formActivator As Object = Activator.CreateInstance(formObj)
            frm = DirectCast(formActivator, Form)
            If frm.Name.Substring(0, 4) = "View" Then
                frm.MdiParent = Me
            End If
            frm.Show()
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial