如何将对象(表单上已经存在的对象)添加到Property的Collection编辑器中? [英] How to add objects(which are already persent on the form) to Collection editor of Property ?

查看:111
本文介绍了如何将对象(表单上已经存在的对象)添加到Property的Collection编辑器中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为 usercontrol 设置了自定义属性,该属性接受按钮数组.

现在,当我在属性窗口中单击usercontrol的属性时,它将显示一个名为 按钮集合编辑器" 的对话框,在其中可以添加或删除按钮的新实例.

但是我想要在此编辑器中的表单上 已经存在 按钮的列表.

我该怎么办?

谢谢&问候

Siddharth

I have made a custom property for my usercontrol which accepts an array of buttons.

Now when I click on that property of usercontrol in properties window, it shows a dialog box called as "Button Collection Editor" in which I can add or remove new instances of buttons.

But I want to have the list of buttons which are already existing on the form in this editor.

How can I do this ?

Thanks & regards

Siddharth

推荐答案

再见,

解决方案非常简单,

检查此链接以获取所有表单控件并选择列表的特定类型

http://stackoverflow.com/questions/3419159/how-to-get-all-child-controls-of-a-windows-forms-form-of-a-specific-type-button [
Hi again,

the solution was pretty easy,

check thislink to get all the form control and select specific type of your list

http://stackoverflow.com/questions/3419159/how-to-get-all-child-controls-of-a-windows-forms-form-of-a-specific-type-button[^]

Hope it helps


这篇关于如何将对象(表单上已经存在的对象)添加到Property的Collection编辑器中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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