Interview questions

.Net - How to create a custom control

Next question>>           Learn .NET
.Net - Explain with code sample how to create a custom control. - June 03, 2009 at 11:00 AM by Shuchi Gauri

Explain with code sample how to create a custom control.

Steps to create a custom control:

a. Create a new project.
b. Add a custom control to the project.
c. Change the name of the class you need to inherit the control from the base class. E.g. inherit the class from System.Windows.Forms.Button if the control s to be inherited from a button class.
d. Implement the control with custom properties and featured needed by the control.
e. Override the OnPaint method if the control’s appearance needs to be changed.
f. Save the build the control
g. Reference you control into another or the same project and use the control.

Next question>>

Also read

How can we create custom controls in ASP.NET?

Custom controls are user defined controls. They can be created by grouping existing controls, by deriving the control from System.Web.UI.WebControls.WebControl or by enhancing the functionality of any other custom control............ 

Describe the different types of user-authored controls in NET.

User authored controls are which not part of the .net framework library. It includes both custom controls and user controls........

Explain with code sample how to create an inherited control.

Steps to create inherited Control:-........

Explain with code sample how to create a user control.

Steps to create a User control:.........

Write your comment - Share Knowledge and Experience


Latest placement tests
Latest links
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring