简体   繁体   中英

.NET WinForms Control class

WinForms应用程序中显示的所有窗口和控件(包括active-x)是否都是从System.Windows.Forms.Control类派生的?

Basically yes.

However, non-visual components such as Timers are derived from Component (or implement IComponent). Only visual elements like Button and Form are derived from Control.

In addition, ActiveX controls don't derive from Control per se, because they're COM components; instead, when you import an ActiveX control, Visual Studio generates a wrapper that derives from AxHost and hosts the COM object. (AxHost itself does derive from Control.)

I think you should take a look at

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 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM