Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add Reference by Code
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00832630
Message ID:
00832746
Views:
14
You can instantiate an object dynamically at run time, kind of like late binding, with System.Activator.CreateInstance.
Dim t As Type = Type.GetType("Myproject.Form1")
Dim myform As Form
myform = CType(System.Activator.CreateInstance(t), System.Windows.Forms.Form)
System.Windows.Forms.Application.Run(myform)
As far as the referencing, you might have to do an Assembly.LoadFrom before you can use the type.

>Hi!
>
>Is there a way to reference a class that i've built by code, like it is done in Vb6?, without the need to add the reference to the project at design time.
>
>
>dim x as object
>set x = createobject("DllName.ClassName")
>
>
>Thanks in Advance!
Previous
Reply
Map
View

Click here to load this message in the networking platform