【问题标题】:get all form details in vb.net在 vb.net 中获取所有表单详细信息
【发布时间】:2010-01-28 06:32:59
【问题描述】:

我想列出当前项目中的所有表单。例子 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

我想要所有表格及其文本。我要做什么先生请帮帮我

【问题讨论】:

标签: vb.net forms


【解决方案1】:

你可以尝试使用一点 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-05-23
    • 2012-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多