gpt4 book ai didi

vb6 - VB 6 如何使自定义集合类支持 For Each

转载 作者:行者123 更新时间:2023-12-04 01:47:50 26 4
gpt4 key购买 nike

我被安排在一个项目中,它的客户端前端是用 VB 6 编写的,确认!我正在尝试开发一个支持 For...Each 语法的自定义集合类。这在VB 6中可能吗?或者我坚持使用 For..Next 和计数器来识别索引。

谢谢您的帮助!

最佳答案

关键部分是将其添加到自定义集合类中...

Public Function NewEnum() As IUnknown
Set NewEnum = m_Employees.[_NewEnum]
End Function

并在过程属性中,将过程 ID 设置为 -4,如下所示:
enter image description here

引用: http://www.vb-helper.com/howto_custom_collection_with_for_each.html

关于vb6 - VB 6 如何使自定义集合类支持 For Each,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5629521/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com