有没有办法在应用程序中查找对象?

发布于 2025-01-07 22:47:29 字数 129 浏览 2 评论 0原文

有没有一种方法可以解析应用程序的对象并确定每个对象是否是 TypeOf 特定的表单对象?我没有找到明确的方法来引用已打开的表单。使问题进一步复杂化的是,在为旧的 PocketPC 设备编码时,似乎并非所有 Visual Basic 命令都可用。

Is there a way that I can parse through the objects of an application and determine if each one is TypeOf a particular form object? I have found no clear way getting a reference to forms that have already been opened. Complicating this further, it appears that not all Visual Basic commands are available to me when coding for an old PocketPC device.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栖迟 2025-01-14 22:47:29

您可能想了解一下 Reflection。有了这个,您可以获取名称空间的所有类型,然后获取所有类的所有成员,然后进行比较。由于反射用于绑定,因此它可能在您的框架中可用。
所以这可能是一个开始:

    Dim MyAssembly = Reflection.Assembly.GetExecutingAssembly
    Dim AllTypes = MyAssembly.GetTypes()
    Dim AllClass = From x In AllTypes Where x.IsClass Select x

You might want to have alook into Reflection. With this you can get all types of a NameSpace, then get all members of all class then do your compare. Since Reflection is used for bindings it might be available in your framework.
So this could be a start :

    Dim MyAssembly = Reflection.Assembly.GetExecutingAssembly
    Dim AllTypes = MyAssembly.GetTypes()
    Dim AllClass = From x In AllTypes Where x.IsClass Select x
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文