Winforms-Calendar
Winforms-Calendar copied to clipboard
Use Calendar.SetRenderHourRange(int StartHour, int EndHour).
Use Calendar.SetRenderHourRange(int StartHour, int EndHour) to render a range of time for each day. But actually not fully be tested.
Thanks for creating this. I'll take a look at it and test it out as soon as I get a chance
I can't seem to get your changes to work in the test harness project. Check below and see if I'm doing something wrong

I can't seem to get your changes to work in the test harness project. Check below and see if I'm doing something wrong
Please do not directly set the StartHour and EndHour.
Because something were done within the constructor of CalendarDay.
Please use the SetRenderHourRange(int StartHour, int EndHour) of the Calendar object instead.
After assign the value to StartHour and EndHour, the Calendar object would useUpdateDaysAndWeeks() to re-construct the Days within the Calendar object and using new assigned StartHour and EndHour.
Notes: I am guessing a situation which might cause some unexpected bugs.
There might be some problem if set an item out of the display range.
For example, if you calendar.SetRenderHourRange(9, 18), and add an item which is started from 17 and end with 19. Or started from 19 and end with 20.
I will try to verify it and resolve it.
This project is really complicated and might spend times, XD.
If I try to use calendar.SetRenderHourRange with the Test Harness then I get an exception. Maybe this is due to the thing you were talking about?

I have update some code in the test project. It seems work now, but still have some problem. 😢
- When the first time the calendar appears, it is not looks good. If you try to scroll it with mouse wheel, the problem could be solved. (Maybe it is needed to be re-painted manually?)
- If the calendar is short than the window, scrolling it with mouse wheel, it is not looks good.
- When you click some date from the month view on the left, then back to today, it disappeared. (🤨)
==================== Seems that the CodeProject version is not as same as this version. And this version is more complecated.