Skip to content

NullReferenceException in monthCalendar after setting MinDate #3034

@kirsan31

Description

@kirsan31
  • .NET Core Version: 3.1.2

  • Have you experienced this same bug with .NET Framework?: No

Problem description:
Set MinDate (monthCalendar1.MinDate = DateTime.Today;) , then select some date in calendar -
NullReferenceException occur:

NullReferenceException
   at System.Windows.Forms.MonthCalendar.MonthCalendarAccessibleObject.GetCalendarCell(Int32 calendarIndex, AccessibleObject parentAccessibleObject, Int32 columnIndex)
   at System.Windows.Forms.MonthCalendar.MonthCalendarAccessibleObject.GetCalendarChildAccessibleObject(Int32 calendarIndex, CalendarChildType calendarChildType, AccessibleObject parentAccessibleObject, Int32 index)
   at System.Windows.Forms.MonthCalendar.MonthCalendarAccessibleObject.GetCalendarChildAccessibleObject(DateTime selectionStart, DateTime selectionEnd)
   at System.Windows.Forms.MonthCalendar.WmDateChanged(Message& m)
   at System.Windows.Forms.MonthCalendar.WmReflectCommand(Message& m)
   at System.Windows.Forms.MonthCalendar.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.Control.ReflectMessage(IntPtr hWnd, Message& m)
   at System.Windows.Forms.Control.WmNotify(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at WinFormsCoreTest1.Program.Main() in d:\save\projects\core tests\WinFormsCoreTest3\Program.cs:line 24

mc

Expected behavior:
No exception.

Windows 7 x64.

Minimal repro:
WinFormsCoreTest4.zip

P.s.

We had grate plans about migration our apps to core. A lot of work were done in research, converting old project to new sdk format and then adopting to core... And after brief view on the result (not even testing!!!) I have found 4 problems that make core variant of WinForms unusable :( At least, until version 5.0 I think: ((((

Metadata

Metadata

Labels

🪲 bugProduct bug (most likely)💥 regression-previewRegression from a preview releasetenet-accessibilityMAS violation, UIA issue; problems with accessibility standards

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions