.NET WinForms控件类

3

所有在WinForms应用程序中显示的窗口和控件(包括ActiveX)都是从System.Windows.Forms.Control类派生而来的吗?

2个回答

4

基本上是的。

然而,像计时器这样的非可视组件是从Component(或实现IComponent)派生的。只有像Button和Form这样的可视元素才是从Control派生的。

此外,ActiveX控件并不是直接从Control派生的,因为它们是COM组件;相反,当您导入一个ActiveX控件时,Visual Studio会生成一个从AxHost派生并托管COM对象的包装器。(AxHost本身确实是从Control派生的。)


0

我认为你应该看一下

http://msdn.microsoft.com/en-us/library/aa651811(VS.71).aspx

Inheritance Hierarchy

System..::.Object

System..::.MarshalByRefObject

System.ComponentModel..::.Component

 System.Windows.Forms..::.Control

   System.Windows.Forms..::.AxHost

   System.Windows.Forms..::.ButtonBase

   System.Windows.Forms..::.DataGrid

   System.Windows.Forms..::.DataGridView

   System.Windows.Forms..::.DateTimePicker

   System.Windows.Forms..::.GroupBox

   System.Windows.Forms.Integration..::.ElementHost

   System.Windows.Forms..::.Label

   System.Windows.Forms..::.ListControl

   System.Windows.Forms..::.ListView

   System.Windows.Forms..::.MdiClient

   System.Windows.Forms..::.MonthCalendar

   System.Windows.Forms..::.PictureBox

   System.Windows.Forms..::.PrintPreviewControl

   System.Windows.Forms..::.ProgressBar

   System.Windows.Forms..::.ScrollableControl

   System.Windows.Forms..::.ScrollBar

   System.Windows.Forms..::.Splitter

   System.Windows.Forms..::.StatusBar

   System.Windows.Forms..::.TabControl

   System.Windows.Forms..::.TextBoxBase

   System.Windows.Forms..::.ToolBar

   System.Windows.Forms..::.TrackBar

   System.Windows.Forms..::.TreeView

   System.Windows.Forms..::.WebBrowserBase

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接