在自定义控件的设计模式下的组合框自定义控件中添加项目 [英] Adding items in combobox custom controls in Designing mode of Custom Controls

查看:74
本文介绍了在自定义控件的设计模式下的组合框自定义控件中添加项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在用户控件的组合框中添加项目...
我需要在该userControls的设计模式下添加项目..

请帮助......急需...

How do i Add items in a combobox which is in a usercontrol...
I need to add item in the Designing mode of that userControls..?

plz help... need urgentally...

推荐答案

错误的主意.您应该从数据中添加项目,而不是通过Designer对其进行硬编码".我必须尝试一下-这样的坏主意从未见过我的脑袋...

好的,如果在Designer中显示控件,则在右上角有一个通常的小错误按钮,单击它-它会弹出带有编辑项目"的组合框任务"-单击它并编辑您的项目.

问题解决了.

但是... 不要这样做!即使项是常量,也应始终根据数据填充或数据绑定控件.您尝试执行的操作根本无法维护.将Designed仅用于布局,别无其他.

—SA
Bad idea. You should add items from data, not "hard-code" them through Designer. I have to try it — such a bad idea never visited my head…

OK, there is a usual small error button on right top edge if the control shown in Designer, click it — it will pop-up "ComboBox Tasks" with "Edit items" — click it and edit your items.

Problem solved.

But… don''t do it! You should always populate or data-bind your controls based on data, even if your items are constants. What you''re trying to do is not maintainable at all. Use Designed only for layouts, nothing else.

—SA


这篇关于在自定义控件的设计模式下的组合框自定义控件中添加项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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