且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将 RenderWindowControl 添加到工具箱

更新时间:2023-12-06 16:45:28

对于设计模式,您需要使用 32Bit 版本,因为 VS 在 32Bit 上运行并且只能加载 32Bit 控件.因此,您可以在设计时使用 32 位版本,并将构建/发布切换到 64 位版本.

For the design mode you would need to use the 32Bit version, because VS is running on 32Bit and can only load 32Bit controls. So you could use for design time the 32Bit version and for build/release switch to the 64bit version.

但您也可以手动添加RenderWindowControl.当然,设计师将无法显示这个,所以它会有必要注释掉,然后再切换到设计器

But you can also add the RenderWindowControl manually. Of course the designer will be unable to display this, so it would be necessary to comment it out, before switching to the designer

打开您的设计器文件,例如Form1.Designer.cs 并添加控件如

Open your designer file e.g. Form1.Designer.cs and add the control like

private RenderWindowControl myRenderWindowControl;

private void InitalizeComponent()
{
    //all other controls added by the designer

    myRenderWindowControl = new RenderWindowControl();
    myRenderWindowControl.SetBounds(0,0,640,480);
    this.Controls.Add(this.myRenderWindowControl);
}