Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to show / showdialog form thru a string
Message
De
18/07/2004 01:58:05
 
 
À
17/07/2004 22:58:48
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00907643
Message ID:
00925534
Vues:
16
Winan,

Maybe someone with some VB knowledge might know better, but I think part of your problem is that you need to cast your oClass to a Form. I think in VB that means you need to use the CType() function, so something like this instead:
Dim DLLName As String = "Test"
Dim ClassName As String ="FrmInvoice"
Dim oClass As Object
Dim oDLL As Object

Dim oForm As Form

oDLL = System.Reflection.Assembly.LoadFrom(DLLName)
oClass = oDLL.CreateInstance(ClassName)
oForm = CType(oClass, Form)
oForm.Show()
~~Bonnie


>To show form via string, I tried to convert your codes into VB.NET:
>
>
>Dim DLLName As String = "Test"
>Dim ClassName As String ="FrmInvoice"
>Dim oClass As Object
>Dim oDLL As Object
>
>oDLL = System.Reflection.Assembly.LoadFrom(DLLName)
>oClass = oDLL.CreateInstance(ClassName)
>oClass.Show
>
>
>but it returned with errors .. I'm sure that I already missed something.. I need advise .. many thanks in advance
>
>Regards
>Winanjaya
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform