使用 .NET Framework 開發自訂的 Windows Form 控制項Developing Custom Windows Forms Controls with the .NET Framework

Windows Form 控制項是可重複使用的元件,這些控制項可封裝使用者介面功能,並可用於用戶端 Windows 應用程式。Windows Forms controls are reusable components that encapsulate user interface functionality and are used in client-side Windows-based applications. Windows Form 不僅提供許多立即可用的控制項,也提供用以開發您自己的控制項的基礎結構。Not only does Windows Forms provide many ready-to-use controls, it also provides the infrastructure for developing your own controls. 您可以結合現有的控制項、擴充現有的控制項,或撰寫您自己的自訂控制項。You can combine existing controls, extend existing controls, or author your own custom controls. 本節提供背景資訊和範例,以協助您開發 Windows Form 控制項。This section provides background information and samples to help you develop Windows Forms controls.

本節內容In This Section

在 Windows Form 中使用控制項的概觀Overview of Using Controls in Windows Forms
重點說明在 Windows Forms 應用程式中使用控制項的基本項目。Highlights the essential elements of using controls in Windows Forms applications.

各種自訂控制項Varieties of Custom Controls
描述可以使用 System.Windows.Forms 命名空間撰寫之各種不同的自訂控制項。Describes the different kinds of custom controls you can author with the System.Windows.Forms namespace.

Windows Form 控制項開發的基本概念Windows Forms Control Development Basics
討論開發 Windows Form 控制項的第一個步驟。Discusses the first steps in developing a Windows Forms control.

Windows Form 控制項中的屬性Properties in Windows Forms Controls
示範如何將屬性加入 Windows Form 控制項。Shows how to add to properties to Windows Forms controls.

Windows Form 控制項中的事件Events in Windows Forms Controls
示範如何在 Windows Form 控制項中處理及定義事件。Shows how to handle and define events in Windows Forms controls.

Windows Form 控制項中的屬性Attributes in Windows Forms Controls
描述可以套用至屬性 (Property) 或您的自訂控制項和元件之其他成員的屬性 (Attribute)。Describes the attributes you can apply to properties or other members of your custom controls and components.

自訂控制項繪製和轉譯Custom Control Painting and Rendering
示範如何自訂控制項的外觀。Shows how to customize the appearance of your controls.

Windows Form 控制項中的配置Layout in Windows Forms Controls
示範如何為控制項和表單建立複雜的配置。Shows how to create sophisticated layouts for your controls and forms.

在 Windows Form 控制項中的多執行緒Multithreading in Windows Forms Controls
示範如何實作多執行緒的控制項。Shows how to implement multithreaded controls.

參考Reference

System.Windows.Forms.Control
描述這個類別,並且提供其所有成員的連結。Describes this class and has links to all of its members.

System.Windows.Forms.UserControl
描述這個類別,並且提供其所有成員的連結。Describes this class and has links to all of its members.

元件的設計階段屬性Design-Time Attributes for Components
列出要套用至元件和控制項的中繼資料屬性,以便在設計階段於視覺設計工具中正確顯示這些屬性。Lists metadata attributes to apply to components and controls so that they are displayed correctly at design time in visual designers.

擴充設計階段支援Extending Design-Time Support
描述如何實作類別,例如提供設計階段支援的編輯器和設計工具。Describes how to implement classes such as editors and designers that provide design-time support.

如何:授權元件和控制項How to: License Components and Controls
描述如何在您的控制項或元件中實作授權。Describes how to implement licensing in your control or component.

另請參閱在設計階段開發 Windows Forms 控制項Also see Developing Windows Forms Controls at Design Time.