rgn2121
asked on
Date range selection using MonthCalendar control in vb.net 2005
I am using the MonthCalendar control on a form trying to allow a user to select either 1 day or a range of days up to 1 week (7 days). I know how to allow this selection and I believe I can handle it fine, but I cannot figure out how to get the control to display the highlighted range.
For instance, if I allow a 'MaxSelectionCount=7' and then run the app, the control loads and I try to select a range by dragging from monday to friday. In doing this, half of Monday is highlighted and half of Friday is Highlighted, but everything in between is a white block. I have not been able to figure out how to make that whole range highlighted as if I just selected one day.
I assume I should be clicking and dragging to select my range...?
I have seen this posted on other forums, but haven't seen a solution yet and didn't see one when I searched here.
Thanks for the help,
rgn
For instance, if I allow a 'MaxSelectionCount=7' and then run the app, the control loads and I try to select a range by dragging from monday to friday. In doing this, half of Monday is highlighted and half of Friday is Highlighted, but everything in between is a white block. I have not been able to figure out how to make that whole range highlighted as if I just selected one day.
I assume I should be clicking and dragging to select my range...?
I have seen this posted on other forums, but haven't seen a solution yet and didn't see one when I searched here.
Thanks for the help,
rgn
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I suggest staying with the current behavior. Selecting multiple days with a MonthCalendar does not actually select multiple days, but a start and end date.
ASKER
Okay...last question. What should I use for a range selection? The one with the drop down?
The one with the dropdown (DateTimePicker) is used for selecting single dates. To select a range of dates, use the MonthCalendar.
ASKER
Like my info shows, I am not an expert in .net or VB, but when the control is click for dat selection, I assume it is invalidated every time the user highlights another day. Can this intercepted along with the Paint event so that it could be highlighted correctly? If that is possible, I am still not sure since there doesn't seem to be a property for the highlighting of the days...
thoughts?