Dim formname As String = "项目名." + dvf.Item(0)("modname_str").ToString.Trim
Dim mytype As Type = Type.GetType(formname)
Dim myform As Form = CType(System.Activator.CreateInstance(mytype), Form)
Dim getwfcodename As String = dvf.Item(0)("modname_str").ToString.Trim
Dim pfrm As Form = DirectCast(getwfcodename, Object)
pfrm.Show()
这样不行,系统错误行Dim pfrm As Form = DirectCast(getwfcodename, Object)提示:无法将类型为“System.String”的对象强制转换为类型“System.Windows.Forms.Form”。