Hey thanks buddy!!! That's awesome!!! I don't speak german but thanks
to google translate I was able to figure it out. Here are my findings:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Dim currentDomain As AppDomain = AppDomain.CurrentDomain
'Provide the current application domain evidence for the
assembly.
Dim asEvidence As Evidence = currentDomain.Evidence 'If we
don't do this, it won't be able to find the assembly of our custom .dll
library
'Load the assembly from the application directory using a
simple name.
'Create the assembly
currentDomain.Load("CustomDLL", asEvidence)
'Get the form
Dim daForm As Form = DirectCast(CreateObject("CustomDLL",
"CustomDLL.Form1"), System.Windows.Forms.Form)
daForm.ShowDialog()
End Sub
Private Function CreateObject(ByVal AssemblyName As String, ByVal
TypeName As String) As Object
'Make an array for the list of assemblies.
Dim assems As [Assembly]() =
AppDomain.CurrentDomain.GetAssemblies()
'Search for the assembly and return the object specified
For Each asm As System.Reflection.Assembly In assems
Console.WriteLine(asm.FullName)
If asm.FullName.StartsWith(AssemblyName & ",") Then
Return asm.CreateInstance(TypeName)
End If
Next asm
End Function
neilsanner
Herfried K. Wagner [MVP] wrote:
<ne********@yahoo.com> schrieb: dim x as string = "2"
eval ("dim myForm as Form = new myDLLName.Form"+x)
I was used to be able to do that in vbScript and found it was very
practical and now I would like to be able to do it in VB.Net if
possible.
<URL:http://dotnet.mvps.org/dotnet/code/techniques/#ClassByName>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>