我正在尝试加载当前网络应用程序中所有表单的标题
以下是代码。
Dim Forms As New List(Of Form)()
Dim formType As Type = Type.GetType("System.Windows.Forms.Form")
For Each t As Type In sender.GetType().Assembly.GetTypes()
If UCase(t.BaseType.ToString) = "SYSTEM.WINDOWS.FORMS.FORM" Then
Dim frm As New Form
frm.Name = t.Name
cmbSelectForm_frmMultiLanguageUtility.Items.Add(frm.Text)
End If
Next
cmbSelectFrom_frmMultiLanguageUtility在运行时加载空值。
请建议
答案 0 :(得分:1)
这将获得所有申请表并将窗口标题添加到组合框:
For Each t As Type In Me.GetType().Assembly.GetTypes()
If t.BaseType.Name = "Form" Then
cmbSelectForm_frmMultiLanguageUtility.Items.Add(CType(Activator.CreateInstance(t), Form).Text)
End If
Next