如何选择在日历控件中可见的月份和年份 [英] how to selected month and year visible in calendar control

查看:288
本文介绍了如何选择在日历控件中可见的月份和年份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了2个下拉列表和日历控件.
第一个下拉列表包含所有月份,另外一个下拉列表包含2年,分别为2012年和2013年.

现在我要从下拉列表中选择一个月和一年,之后我要在日历控件中看到特定的选定月和年.

如何?请帮助我..

I am used 2 drop down list and calendar control.
first dropdownlist having all months, another one dropdownlist having 2 years of 2012 and 2013.

now i am selecting one months and year from dropdownlist, after that i want particular selected months and year visible in calendar control.

how is it? please help me..

推荐答案

尝试使用Calendar.selectdate(Datetime)
传递ur下拉值作为输入...
try with Calendar.selectdate(Datetime)
pass ur dropdown values as input...


在Button中编写以下编码:

Calendar1.VisibleDate = new DateTime(Calendar1.TodaysDate.Year,ddl_month.SelectedIndex + 1,1);
Write Following coding in Button:

Calendar1.VisibleDate = new DateTime(Calendar1.TodaysDate.Year, ddl_month.SelectedIndex+1,1);


这篇关于如何选择在日历控件中可见的月份和年份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆