最近我一直在尝试创建一个 activeX 控件并在一些 vb.net 代码中使用它。经过一番努力,我在 vb6 中创建了控件并生成了 ocx 文件。我一直在尝试使用它,如 microsoft docs here 中所示但无济于事。 上:
myActiveX = New MyActiveXComponent.MyClass()
我不断得到
MyActiveXComponent.MyClass.Private Sub New() is not accessible in this context because it is 'Private'
我可以将它导入到工具箱并以这种方式使用,但我不想这样做,我使用的是 Visual Studio 2005。此外,我有一个 ocx,令我惊讶的是,我可以使用两种方式(不是我的),所以我怀疑有问题和我的一样,但我不知道是什么。
最佳答案
关于vb.net - OCX控制: Sub New() is not accessible in this context because it is 'Private' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55145485/