Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add Reference by Code
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00832630
Message ID:
00832746
Vues:
15
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!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform