Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Sir,
I am using DateTimePicker in Windows application.
My requirement is when I am selecting DateTime picker It should display Current month & next month Calenders.


Is there any way please help me.


Thanks & Regards

O.kranthi kumar
M.C.A
Posted

1 solution

the DateTimePicker can show only one calender at a time. But if you want to show two calenders at a time, then you can dynamically adding another monthcalender when the datetimepicker is dropped down.

C#
MonthCalender cln= new MonthCalender();
private void DateTimePicker1_DropDown(object sender,
        System.EventArgs e)
    {
     cln.now.AddDays(30);
     cln.location = new point(x,y); //your preffered location
     this.controls.Add(cln);;

private void DateTimePicker1_CloseUp(Object sender, EventArgs e) 
{
cln.Hide();

}
 
Share this answer
 
Comments
kranthi.oru 6-Aug-11 2:18am    
Ur idea is super.
hie your idea is super but This month is August it automatically come in Datetimepicker... But i want September month in month calender what can i do.. Please help me.
Praveen Kullu 6-Aug-11 2:30am    
Then do like this,
dateTimePicker1.Value.AddDays(30);
and don't add days to calender. If my solution worked for you, then do accept it.
Praveen Kullu 8-Aug-11 8:45am    
What a nice way to say thanks for trying to solve your problem. :(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900