如何创建需要其他控件属性的控件?
我刚刚创建一个使用 ToolTip 控件,我想到这个控件(或术语上正确的组件)提供设计时属性对于表单上的所有其他控件。
我怎样才能实现这一点来控制我的设计?
I was just creating a Windows form that uses a ToolTip control and it occurred to me that this control (or component to be right on the terminology) provides design time properties for every other control on the form.
How can I achieve this for a control of my design?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个神奇之处是通过继承和实现 IExtenderProvider 接口创建的。这很容易做到,设计师正在做所有繁重的工作。这篇MSDN Library 文章中有一篇非常好的操作方法。
That bit of magic is created by inheriting and implementing the IExtenderProvider interface. It is pretty easy to do, the designer is doing all the heavy lifting. There's a very good How To in this MSDN Library article.