Menu

NullReferenceException in System.Drawing if appointment goes from one day to another

Dan GK
2015-10-19
2016-11-15
  • Dan GK

    Dan GK - 2015-10-19

    Keep getting NullReferenceException in System.Drawing when I make an appointment that goes from (for example) October 6th 11:50pm into October 7th 2:00am.
    Is there a fix for this? No source was provided so I can't fix this myself

     
    • D.J. Rutherford

      D.J. Rutherford - 2015-11-09

      Dan,
      I got the same error initially, I discovered it's due to the fact that the item font isn't defaulted to anything, so if you add any items with text the draw fails. Try specifying a font (both for the calendar and the items) and you should be fine.

       
      • Anton Norko

        Anton Norko - 2015-11-13

        It works, thanks.
        Honestly - it should be added to sources - automatically init of ItemsFont property.

         
  • D.J. Rutherford

    D.J. Rutherford - 2015-11-09
     

    Last edit: D.J. Rutherford 2015-11-09
  • Robert Brown

    Robert Brown - 2016-11-15

    Hi, I know this post is over 1 year old, but I am getting the Null Reference when adding items in the
    routine of WindowsFormsCalendar.CalendarRenderer.PerformItemsLayout

    Is the the same as you have stated above?

    I have fonts selected in both Calendar and Items and it still fails.

    I do notice though, that the Calendar items do have the item loaded into it, so it must be something to do with placing it on the Calendar.

    Are you able to help in anyway as this has been driving me crazy for 2 days.

    Thanks,
    Rob

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.