Posts

Showing posts from February, 2019

Creating Custom Control in C#.Net Windows Appliation

Image
Introduction of Custom Control. There are situations, when you need some specific functionality in a control, which is not provided by the built-in C#.Net controls. In such situations, you can create user controls and custom controls according to the requirement. Custom control is a class, which you write and it derives form Control Classes. Steps to Create a Custom Control 1. Add a Custom Control in your application, as CustomControl1.cs.   2. Select the Custom Control from the list.   3. Add the mentioned Code in CustomControl1.cs File. using System; using System.Drawing ; using System.Windows.Forms ; namespace WindowsFormsApplication2 {     public partial class CustomControl1 : Control     {         public CustomControl1()         {             InitializeComponent ();         }         protected override void OnPaint ( PaintEventArgs pe )         {             base .OnPaint ( p