Is it Possible to Restrict the Dates that are Selected in Windows Forms MonthCalendarAdv(Classic)
3 Sep 2020 / 1 minute to read
Yes, we can restrict the dates that are selected. If you want to allow the user to select only Mondays on the calendar, you can set Clickable property to false
for other days except Monday using DateCellQueryInfo event handler.
void monthCalendarAdv1_DateCellQueryInfo(object sender, DateCellQueryInfoEventArgs e)
{
// if not Monday
if (e.ColIndex != 2)
{
e.Style.Clickable = false;
e.Style.Enabled = false;
}
}
Private Sub monthCalendarAdv1_DateCellQueryInfo(ByVal sender As Object, ByVal e As DateCellQueryInfoEventArgs)
' if not Monday
If e.ColIndex <> 2 Then
e.Style.Clickable = False
e.Style.Enabled = False
End If
End Sub
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page