控件是组件吗?
只是术语问题。有些文章提到像Button、Panel、SplitPanel等都是控件。有些称为组件。两者都正确吗?
Just terminology question. Some articles mention that things like Button, Panel, SplitPanel, etc. are controls. Some called components. Is Both correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我认为您谈论的不是 Visual Studio,而是 .NET。
System.Windows.Forms.Control 类签名:
System.ComponentModel.Component 类签名:
因此,控件是一个组件。
I think you're talking not about Visual Studio, but .NET.
System.Windows.Forms.Control class signature:
System.ComponentModel.Component class signature:
Thus, a Control is a Component.
控件
是一个可视化组件。每个控件都是一个组件,但并非所有组件都是控件。The
Control
is a Visual Component. every control is a component but not all the components are controls.控件是一种组件。
类库也被视为组件。
组件是分布在一个包(即 dll)中的一组(通常相关的)类。
Controls are one kind of component.
Class libraries are also considered components.
A component is a set of (normally related) classes distributed in one package (i.e. a dll).
控件是一个组件;但组件不一定是控件。
A control is a component; but a component is not necessarily a control.
嗯,从视觉上来说,组件通常是控件的子集。只需检查“工具”选项卡,您就会看到一个名为“组件”的部分。
它们是在表单上没有直接视觉表示的控件,例如 ErrorProvider、ImageList、Timer 等...
Well,visually speaking usually components are a subset of controls. Just check the tools tab and you will see one section called components.
They are controls that have not a direct visual representation at the form like an ErrorProvider, an ImageList, a Timer, etc ...