简体   繁体   English

继承现有的ActiveX控件

[英]Inheriting Existing ActiveX Control

I am currently working with a 3rd party ActiveX Control (an editor for topographical data distributed by Cadcorp SIS). 我目前正在与第三方ActiveX控件(由Cadcorp SIS分发的地形数据编辑器)合作。 I have to do some fairly complex stuff with it in a VB.NET (framework 4) program and am finding that the API that comes with the control is quite limited. 我必须在VB.NET(框架4)程序中用它做一些相当复杂的事情,并且发现控件附带的API相当有限。

As of now I have made a custom control which houses the control and acts as a wrapper for it to allow me to extend the API, which works fine, but What I would really like to do it give the control more events so that I can monitor what is going on with the data more closely. 到目前为止,我已经制作了一个自定义控件,该控件包含该控件并充当其包装,以允许我扩展API,效果很好,但是我真正想做的事情为该控件提供了更多事件,以便我可以密切监视数据的状况。

I'm not sure how to go about doing this though... 我不确定如何去做...

I tried inheriting from the control and I can extend it just fine, but I can't figure out how to reuse it after that. 我尝试从控件继承,并且可以很好地扩展它,但是在此之后我不知道如何重用它。 Is there some way I can inherit the control and get it to appear in the toolbox so I can just drop it onto a form? 有什么方法可以继承控件并将其显示在工具箱中,以便将其拖放到表单上? Or do I have to load it programatically? 还是我必须以编程方式加载它? If so, how can I do it? 如果是这样,我该怎么办?

Any pointers, examples, tutorials or alternative ideas as to how to do this kind of thing would be welcome. 任何有关如何进行此类操作的指针,示例,教程或替代想法都将受到欢迎。

If you are not seeing your control class in toolbox it doesn't mean that you can't use it just modify code from your form's designer to use your inherited class 如果您没有在工具箱中看到控件类,那并不意味着您不能使用它,只需修改表单设计器中的代码即可使用继承的类

Or 要么

You can drag-and-drop your assembly (dll) from Windows Explorer to the toolbox in VS.NET. 您可以将程序集(dll)从Windows资源管理器拖放到VS.NET中的工具箱中。 Or you can right click on the toolbox in VS.NET and choose Add/Remove items. 或者,您可以右键单击VS.NET中的工具箱,然后选择“添加/删除项目”。 Is this what you are looking for? 这是你想要的?

Also

<ToolBoxItem(True), ToolboxBitmap("MyNamespace.MyClass.bmp")> _
    Public Class MyClass

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM