Introduction
Well I'm back with a new small usercontrol. a few days ago one of my customers asked me if it was possible to give a user the possibility of either writing a date in a textfield or just doubleclick it to get a Datepicker, so i made this control. This control adds the Date pick to Labels , TextBox, HTML inputfields and Divs. What it does is when bound to the mentioned controls is adding the ability of double clik a control and the popup a DatePicker. you can have as many datepickers on a page as you like and it easy to change the look of the control by using VS Calandar properties. To use the control just add the control to your project by using the add existing in solution explorer. select the files "Remember the close.jpg". Then drag the control to the page where you want to use it, and set the properties.
You must set the following 3 properties on the DateSelector control.
DateFormat="dd-MM-yyyy". This property set the dateformat to your liking, defaults to localdatetime if not set.
ParentControlId="TextBox1". The id of the control you which to bind to.
PrevDate="true". Is it allowed to select a date previous to today's date. When this is set to false the control sets the date to todays date if date selected is older than todays date.
The javascript is tested to run in Opera 8.0, Firefox 1.06 and IE 6+
The Demo project provided show the use of the control.
NEW:
I have updated the control since it used absolute positioning on parent controls
Now it will open the calendar according to mouse positioning and you can place the close.jpg anywhere in your project
// Programmer Jan Nielsen
<font color="#008000" size="2"><P>
</font>