16,721
社区成员




Dim gsAutoOpenFormID As String = "TF9001" '假设用户想要打开[TF9001小实验]这个窗体
Dim AutoOpenFormType As Type = Nothing
If gsAutoOpenFormID <> "" Then
For Each theType As Type In System.Reflection.Assembly.GetExecutingAssembly.GetTypes '不满意
If theType.Name.StartsWith(gsAutoOpenFormID, StringComparison.CurrentCultureIgnoreCase) Then '不满意
If theType.IsSubclassOf(GetType(Form)) Then
AutoOpenFormType = theType
Exit For
End If
End If
Next
End If
If AutoOpenFormType IsNot Nothing Then
fMainForm = Activator.CreateInstance(AutoOpenFormType)
End If