vb.net 在 VB .net 2010 中创建 ActiveX 控件(OCX)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25563436/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 18:07:29  来源:igfitidea点击:

Creating ActiveX control(OCX) in VB .net 2010

vb.netvisual-studio-2010dllactivexocx

提问by xtian

I would like to create an activeX control(OCX) in VB .net 2010 is it possible? I having a hard time determining how to make it because I only get a .dll file rather than a .ocx which can be seen in vb6. I hope you can answer my question.

我想在 VB .net 2010 中创建一个 activeX 控件(OCX) 可以吗?我很难确定如何制作它,因为我只得到一个 .dll 文件,而不是可以在 vb6 中看到的 .ocx。我希望你能回答我的问题。

回答by Steve

Are you asking how to create an "ActiveX" control specifically or are you asking how to create controls that can be used by other CLR based applications?

您是在询问如何专门创建“ActiveX”控件,还是在询问如何创建可供其他基于 CLR 的应用程序使用的控件?

To create an ActiveX control, see this link which walks you through the steps to do this: Creating an MFC ActiveX Control

要创建 ActiveX 控件,请参阅此链接,该链接将引导您完成执行此操作的步骤:创建 MFC ActiveX 控件

To create standard controls, you use a dll (class library) and can add as many controls to it as you like. You don't need a dll for each control, although you can.

要创建标准控件,您可以使用 dll(类库)并可以根据需要向其中添加任意数量的控件。尽管可以,但您不需要每个控件都需要一个 dll。