压光机控制限制 [英] Calender control restriction
本文介绍了压光机控制限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要限制在1900年之前和2100年之后选择压光机控制.我该怎么做.请帮助我解决这个问题.
I need to restrict selecting calender control before year 1900 and after year 2100. How can I do this. Please help me to solve this.
推荐答案
检查以下链接,这些可能会对您有所帮助:
Restrict-the-Calendar-selection-within-a-specific-范围 [ ^ ]
如何从日历控件中动态禁用选定日期 [ ^ ]
http://forums.asp.net/t/1161833.aspx [
Check following links, these might help you:
Restrict-the-Calendar-selection-within-a-specific-range[^]
How to Disable Selected Dates dynamically from the Calendar Control[^]
http://forums.asp.net/t/1161833.aspx[^]
You can check if following code helps you, its in VB.Net, you can convert it to C# if that is your language:
Private Sub Calendar1_DayRender(sender As Object, e As DayRenderEventArgs)
If e.Day.Date < BeginningOfDateRange
e.Cell.BackColor = System.Drawing.Color.LightGray
e.Day.IsSelectable = False
End If
If e.Day.Date > EndOfDateRange Then
e.Cell.BackColor = System.Drawing.Color.LightGray
e.Day.IsSelectable = False
End If
End Sub
这篇关于压光机控制限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文