我希望列出当前项目中的所有表单。例 listbox1.items.add(form1.name& form1.text)
我想在当前项目中加载所有表单详细信息。
以下代码仅提供开放表格。
For linti As Integer = Application.OpenForms.Count - 1 To 0 Step -1
Application.OpenForms.Item(linti).Text
Application.OpenForms.Item(linti).name
Next
我想要所有表格及其文字。我做什么先生请帮助我
答案 0 :(得分:0)
使用一点Linq你可以尝试
Dim list = AppDomain.CurrentDomain.GetAssemblies().ToList(). _
SelectMany(Function(s) s.GetTypes()). _
Where(Function(p) (p.BaseType Is [GetType]().BaseType AndAlso _
p.Assembly Is [GetType]().Assembly))
For Each type As Type In list
Dim typeName As String = type.Name
Next