如何正确继承x64的图表控件 [英] How to Properly Inherit Chart Control for x64

查看:61
本文介绍了如何正确继承x64的图表控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这应该是微不足道的。 我想继承Chart控件,以便我可以编写自定义操作(如使用鼠标滚轮缩放等)和自定义上下文菜单等。 显然,继承如下代码所示:

This should be a trivial.  I want to inherit from the Chart control so that I can code custom actions (like zooming with mouse wheel, etc.) and custom Context Menu's, etc.  Obviously, the inheritance goes as the code below:

namespace CustomChart {

	public ref class MyChart : System::Windows::Forms::DataVisualization::Charting::Chart

但是,将此控件添加到其他x64项目似乎存在问题。 似乎需要在x86中编译控件,并将其添加到x86中的其他项目中,以便能够查看并修改它等等。 然后在你完成
x86中的所有内容后,返回并编译为x64并更改对x64版本的引用等,然后你可以部署你的x64项目。

However, there seems to be a problem in adding this control to other x64 projects.  It seems that the control needs to be compiled in x86, and added to other projects in x86 in order to be able to see it and modify it, etc.  Then after you're done everything in x86, go back and compile for x64 and change the references to the x64 builds, etc., and then you can deploy your x64 project.

在x64中编译时,我似乎无法无缝地继承并添加到Chart控件的其他项目。 看来你必须先在x86中做所有事情,然后在x86完成编码和安排你的其他项目的表单后,然后将
所有内容更改为x64,以便部署x64版本(但是你无法使用x64中的自定义图表编辑表单。

I cannot seem to seamlessly inherit and add to other projects the Chart control when compiled in x64.  It seems that you have to do everything first in x86, and then after you're done coding and arranging your other project's form in x86, then change everything to x64 in order to get the x64 build to deploy (but you cannot edit the form with the custom chart in x64).

有什么想法吗?

推荐答案

为了使它更清晰:不能在Forms工具箱中添加一个用x64编译的控件。 您只能向工具箱中添加编译为x86的控件。

To make it more clear: one cannot add to the Forms toolbox a control compiled in x64.  You can only add controls to the toolbox which are compiled as x86.

当然,您可以将标准Chart控件从工具箱添加到x64项目中,并且没有任何问题,如果您有Chart控件的自定义用户行为,您可以编写项目中的所有内容...但是,将独立的
继承的自定义图表控件编译为x64并具有自己的功能然后可以添加更好到工具箱,然后在x64中添加到其他Form项目。

Of course you can add the standard Chart control from the toolbox to an x64 project and and not have any issues, and if you had custom user behaviour for the Chart control you could code all that in the project...however, it would be nicer to have an independent inherited custom chart control compiled as x64 with its own features that can then be added to the toolbox and then added to other Form projects all in x64.


这篇关于如何正确继承x64的图表控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆