Custom Control

Definition - What does Custom Control mean?

Custom control is a control that is not included in the .NET framework library and is instead created by a third-party software vendor or a user.

Custom control is a concept used while building both Windows Forms client and ASP.NET Web applications. Custom client controls are used in Windows Forms applications, while custom server controls are used in ASP.NET pages (Web forms). Using custom controls is easier in .NET than the earlier Windows versions due to simple programming techniques.

Custom control is a generic term that also includes user controls. User control in ASP.NET is created using ASP.NET code and is reused in other Web pages, whereas user control in the context of Windows Forms implies a composite control with a consistent user interface (UI) and behavior within or across applications.

Techopedia explains Custom Control

.NET framework provides the class, System.Windows.Forms.Control, to build custom client control in Windows Forms. This class provides all the basic functionality necessary for controls, but does not provide any control-specific functionality or any graphical interface. Hence, it provides more flexibility than user control in defining the control to suit to application requirements by allowing an override of the default behavior of Windows message handling. Hence, knowledge of the Windows 32 API is essential to use this concept effectively. Windows Forms does not support windowless controls. However, it allows for the hosting of ActiveX controls, which can be windowless.

To generate custom control in ASP.NET, the framework class, System.Web.UI.WebControl, should be used along with System.Web.UI.Control to render non-visual elements. These controls provide the ability to be shipped as a dynamic link library (.dll), which can be precompiled and integrated with Visual Studio Integrated Development Environment.

Some of the aspects that need to be considered while building custom controls include the definition of properties with their default values, which need to be displayed in Visual Studio IDE, behavior in the UI layout (like tab order, UI cues, etc.), and custom events. Sometimes, custom control can be built by combining built-in controls to provide complex functionality.

It is recommended that custom controls be used when customized graphical representation of the control is needed or when there is a need to implement custom functionality that is not provided by standard controls.

This definition was written in the context of .NET.
Posted by:

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
Techopedia on Twitter

Sign up for Techopedia's Free Newsletter!
Techwise Webinar Series
Understanding the Big Data Landscape
Understanding the Big Data Landscape
Big Data is everywhere, that's for sure. But the big question for today's savvy enterprise is: exactly where does Big Data fit into your organization?

Email Newsletter

Join 138,000+ IT pros on our weekly newsletter

Free 30 Day Trial: SolarWinds® Log & Event Manager
Free 30 Day Trial: SolarWinds® Log & Event Manager:
Use this powerful SIEM to tackle compliance audits, perform root cause analysis and manage all logs in one place.
Free Whitepaper – Bridging the IT Operations Application Owner Gap
Free Whitepaper – Bridging the IT Operations Application Owner Gap:
Conflicting organizational needs all too often create tension between functional silos. Application owners demand more and more resources.
Free 30 Day Trial – VMTurbo Operations Manager
Free 30 Day Trial – VMTurbo Operations Manager:
VMTurbo's flagship product, Operations Manager maintains your virtual and cloud environments in a healthy state. It manages homogeneous and...