Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to show / showdialog form thru a string
Message
From
18/07/2004 01:58:05
 
 
To
17/07/2004 22:58:48
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00907643
Message ID:
00925534
Views:
18
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform