在vb.net获取所有表单详细信息 [英] get all form details in vb.net
本文介绍了在vb.net获取所有表单详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想列出当前项目中的所有表格。示例
listbox1.items.add(form1.name& form1.text)
我想在当前项目中加载所有表单细节。
以下代码仅适用于打开的表单。
对于linti As Integer = Application。 OpenForms.Count - 1 To 0 Step -1
Application.OpenForms.Item(linti).Text
Application.OpenForms.Item(linti).name
Next
我想要所有表单及其文本。我要做什么,请帮助我
解决方案
使用一点Linq,您可以尝试
Dim list = AppDomain.CurrentDomain.GetAssemblies()。ToList()。 _
SelectMany(函数s.GetTypes())。 _
其中(函数(p)(p.BaseType是[GetType]()。BaseType AndAlso _
p.Assembly是[GetType]()。Assembly))
对于每种类型As键入列表
Dim typeName As String = type.Name
Next
i want list all forms in current project. example listbox1.items.add(form1.name & form1.text)
i want load all form details in current project.
the following code give for only open forms.
For linti As Integer = Application.OpenForms.Count - 1 To 0 Step -1
Application.OpenForms.Item(linti).Text
Application.OpenForms.Item(linti).name
Next
i want all form and its text. what i do sir please help me
解决方案
Using a bit of Linq you could try
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
这篇关于在vb.net获取所有表单详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文