If there is a calendar control to be included in each page of your application, and and we do not intend to use the Microsoft-pr

Q

If there is a calendar control to be included in each page of your application, and and we do not intend to use the Microsoft-provided calendar control, how do you develop it? Do you copy and paste the code into each and every page of your application?

✍: Guest

A

Create the Calendar User Control
The control we will create will contain a calendar control and a label which has the corresponding date and time written
Steps are:-

Creating a CalenderControl
1) To begin, open Visual Studio .NET and begin a new C# Windows Control Library.
2) You may name it whatever you like, for this sample the project name will be CalenderControl

Using the Calender Control in a Windows Application
It’s just like adding any other control like a button or a label.
1) First, create a new Windows Application project named: CustomControl.
2) Add a reference to the Calender Control DLL named: CalenderControl.dll.
3) Now you a can customize the Toolbox:
Right-Click the Toolbox> .NET Framework Components> Browse> select the CalenderControl.dll.
4)The Calender Control is now added to the Toolbox and can be inserted in Windows Form as any other control. The control itself will take care of the date display

2014-09-19, 1503👍, 0💬