在VB中创建用于用户控制的界面 [英] Create interface for usercontrol in VB

查看:65
本文介绍了在VB中创建用于用户控制的界面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿!


我想在VB.net中为用户控件创建一个接口,以便可以以相同的方式在不同的.dll中使用用户控件.

(就像网络浏览器中的工具栏一样,所以我的父程序不得不问一些事情,并且将会发生用户控件的事件,该事件应该由它的elelve形式处理.)

所以我的问题是:
我是否必须指定它是一个用户控件?
如果是这样,您如何在界面中进行设置?


感谢您的答复,

问候,

wimvr

Hey!


I want to create an interface for a usercontrol in VB.net so I can use usercontrols in different .dll''s in the same way.

(Like toolbars in webbrowsers so my parentprogram have to ask some things and there will be an event of the usercontrol that should be handled by the form itselve.)

So my question is:
Do I have to specify that it''s a usercontrol?
If so, how do you set in your interface?


Thanks for your reply,

regards,

wimvr

推荐答案

不,您不必这样做.为什么? 指定用户控件"的含义是什么?并不是说您需要或不需要这样做,整个概念没有任何意义.你知道是什么类型的吗?遗产?运行时与编译时类型?您应该了解所有内容,并且还要进行一些编程.类型是类型,没有什么可指定的.



感谢您对目标的解释.这是您需要了解的关于UserControl的内容.与基类System.Windows.Controls.ContentControl相比,类System.Windows.Controls.UserControl没有基本的附加功能,与基类System.Windows.Forms.ContainerControl相比,类System.Windows.Forms.UserControl没有基本的附加功能.请参阅:
http://msdn.microsoft.com/en-us/library/system. windows.forms.usercontrol.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system. windows.controls.usercontrol.aspx [ ^ ].

用户控件类的主要目的是它们可以与Designer合作.现在,设计器是用于快速创建简单即席控件的工具.如果您尝试使用Designer进行更认真的工作,那只会浪费时间,因为使用Designer完全是手动的无效工作.因此,很难说用户控件类是否可以构成良好的插件界面.我宁愿建议您将插件接口基于WPF的类System.Windows.Controls.ControlSystem.Windows.UIElement或类System.Windows.Forms.Control,以便为插件开发人员提供更全面的开发功能面板,其中用户控制只是其中的一个UI插件的方法.

—SA
No, you don''t have to. Why? And what "specify that it''s a user control" would mean? Not that you need or need not to do it, the whole notion makes no sense. Do you understand what is the type? Inheritance? Run-time vs compile-time type? You should understand it all and a lot more to do some programming. A type is a type, there is nothing to specify.



Thank you for explanation of your goals. Here is what you need to understand about the UserControl. The class System.Windows.Controls.UserControl had no essential additional functionality compared to its base class System.Windows.Controls.ContentControl and the class System.Windows.Forms.UserControl had no essential additional functionality compared to its base class System.Windows.Forms.ContainerControl. Please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.controls.usercontrol.aspx[^].

The main purpose of user control classes is that they can cooperate with the Designer. Now, the Designer is the tool for creation of simple ad-hoc controls quickly. If you try to do a bit more serious work with the Designer, you just waste time, because using the Designer is all manual ineffective work. So, it''s hard to say if the user controls classes can make a good plug-in interface. I would rather advise to base you plug-in interfaces on the class System.Windows.Controls.Control or System.Windows.UIElement for WPF or the class System.Windows.Forms.Control, to give the plug-in developers more comprehensive palette of development capabilities where user control would be just one of the ways to develop the UI plug-ins.

—SA


这篇关于在VB中创建用于用户控制的界面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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