Question

How can i disable the past date and only enable 3 dates from today's date in monthcalendar using vb.net? I couldn't find the dayrender event.

Any ideas?

Thanks in advance.

Était-ce utile?

La solution

You can makeuse of MinDate and MaxDate property of the MonthCalendar control to achieve your need,

CODE:

MonthCalTest.MinDate = New DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day)
MonthCalTest.MaxDate = MonthCalTest.MinDate.AddDays(3)

MINDATE - MAXDATE

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top