如何使用Vb.Net获取我项目中所有表单的列表 [英] How I Can Get List Of All Forms In My Project Using Vb.Net
本文介绍了如何使用Vb.Net获取我项目中所有表单的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用以下任何一种形式的简单代码编写列出我项目中的所有表单
这里我有一个代码只返回打开的表单名称
Hi,
I need to list out all of forms in my project using simple code write in any one of those form
here i got one code which only returns form name that is open
For Each frm In Application.OpenForms
MessageBox.Show(frm.Name)
Next
但是什么关于尚未公开但在解决方案中的表格...
请帮助
but what about forms which is not open but is in the solution ...
please help
推荐答案
检查这个链接希望这对你有帮助。
http://stackoverflow.com/questions/2152739/get-all-form-details-in-vb-net [ ^ ]
http://stackoverflow.com/questions/17387080/how-to-populate-listbox-with-a-list-of-all-open-forms [< a href =http://stackoverflow.com/questions/17387080/how-to-populate-listbox-with-a-list-of-all-open-formstarget =_ blanktitle =New Window> ^ ]
如何从vb.net 2008项目中获取表单名称? [ ^ ]
http:// stackoverflow。 com / questions / 16118946 / c-sharp-form-of-project-of-project-a-from-project-b [ ^ ]
http://stackoverflow.com/questions/ 23194993 / how-to-get-all-forms-and-user-controls-in-winforms-project [ ^ ]
Check this links hope this will help you.
http://stackoverflow.com/questions/2152739/get-all-form-details-in-vb-net[^]
http://stackoverflow.com/questions/17387080/how-to-populate-listbox-with-a-list-of-all-open-forms[^]
How, can i get forms name from vb.net 2008 project?[^]
http://stackoverflow.com/questions/16118946/c-sharp-get-form-names-of-project-a-from-project-b[^]
http://stackoverflow.com/questions/23194993/how-to-get-all-forms-and-user-controls-in-winforms-project[^]
请检查
http://stackoverflow.com/questions/2359574/how-to-get-all-forms-in-a-vb-net-vs08-project-in-an-array [ ^ ]
谢谢大家这是解决问题我得到了解决方案
Thanks all of you this is solve problem i got solution
Dim myAssembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
Dim types As Type() = myAssembly.GetTypes()
For Each t As Type In types
If UCase(t.BaseType.ToString) = "SYSTEM.WINDOWS.FORMS.FORM" Then
messagebox.show(t.name)
End If
Next
这篇关于如何使用Vb.Net获取我项目中所有表单的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文