请问:Dim frm As Form = New Form ,这个new 后面的Form 可以是变量吗?
我想根据条件来决定实例化不同的form,例如:
tj=1 Dim frm As Form = New From1
tj=2 Dim frm As Form = New Form2
想通过循环来引用,就出现了Dim frm As Form = New Form(i),这样可以实现吗?要如何实现
[解决办法]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TryCast(System.Reflection.Assembly.GetExecutingAssembly.CreateInstance("WindowsApplication29.Form1"), Form).Show() End Sub