添加使用Windows窗体设计器用户控件 [英] Adding a user control using Windows Form designer

查看:120
本文介绍了添加使用Windows窗体设计器用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个非常明显的问题,但我只是不明白。

This is probably an incredibly obvious question, but I just can't figure it out.

我通过表单设计管理的Windows窗体。我想包括一个自定义用户控件,也窗体设计管理。但我无法得到自定义控件出现在工具箱中,即使我尝试手动添加它下的选择项目...对话框。

I have a Windows Form managed by the form designer. I'd like to include a custom user control, also managed by the form designer. But I'm unable to get the custom control to show up in the Toolbox, even if I try manually adding it under the "Choose Items..." dialog.

这两个窗体和控件在同一个组件。我试着控制分离成一个单独的程序,以便按照指示这里到信中,都无济于事。我还使用C ++ / CLI,如果改变任何东西。

Both form and control are in the same assembly. I've tried separating the control into a separate assembly in order to follow the instructions here to the letter, to no avail. I'm also using C++/CLI, if that changes anything.

有一个属性还是我等应设置为我控制,以便它出现在设计工具箱?

Is there an attribute or such I should be setting to my control in order for it to appear in the Designer Toolbox?

推荐答案

是的,有一个。唯一一个我知道,$ P $的pvents从显示出来工具箱中如果类是在同一项目中的控制。工具+选项,Windows窗体设计器,通用,AutoToolboxPopulate应设置为True。的默认值。

Yes, there is one. The only one I'm aware of that prevents a control from showing up in the toolbox if the class is in the same project. Tools + Options, Windows Forms Designer, General, AutoToolboxPopulate should be set to True. The default value.

这篇关于添加使用Windows窗体设计器用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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