DateTimepicker控件在Windows应用程序中获取两个日历 [英] DateTimepicker control gettng two calenders in windows application
本文介绍了DateTimepicker控件在Windows应用程序中获取两个日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
先生,
我在Windows应用程序中使用DateTimePicker.
我的要求是当我选择DateTime选择器时,它应该显示当前月份"和下个月日历".
有什么办法可以帮助我.
谢谢与问候
O.kranthi kumar
M.C.A
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
推荐答案
DateTimePicker一次只能显示一个日历.但是如果要一次显示两个日历,则可以在下拉datetimepicker时动态添加另一个monthcalender.
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.
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();
}
这篇关于DateTimepicker控件在Windows应用程序中获取两个日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文