Bug 23682 - DateTimePicker fails with ArgumentOutOfRangeException when trying to select a date beyond MaxDate
Summary: DateTimePicker fails with ArgumentOutOfRangeException when trying to select a...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Community
Assignee: Bugzilla
Depends on:
Reported: 2014-10-08 11:26 UTC by Cristian Ciupitu
Modified: 2017-09-01 11:56 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

DateTimePicker example program that fails with ArgumentOutOfRangeException (1.95 KB, text/x-csharp)
2014-10-08 11:26 UTC, Cristian Ciupitu

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 23682 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Cristian Ciupitu 2014-10-08 11:26:20 UTC
Created attachment 8352 [details]
DateTimePicker example program that fails with ArgumentOutOfRangeException

If the user tries to change the month of DateTimePicker control beyond the MaxDate, the control fails with ArgumentOutOfRangeException.

Version used:

How to reproduce:
1. Download the attached program
2. Compile it:

       mcs -r:System.Data,System.Drawing,System.Windows.Forms DateTimePicker-ArgumentOutOfRangeException-bug.cs

3. Run it, select the month then press the UP key.

System.ArgumentOutOfRangeException: value must be between MinDate and MaxDate
Parameter name: value
  at System.Windows.Forms.DateTimePicker.set_Value (DateTime value) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DateTimePicker.SetPart (Int32 value, DateTimePart dt_part, Boolean adjust) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DateTimePicker.IncrementSelectedPart (Int32 delta) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DateTimePicker.KeyDownHandler (System.Object sender, System.Windows.Forms.KeyEventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.OnKeyDown (System.Windows.Forms.KeyEventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.ProcessKeyEventArgs (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.ProcessKeyMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WmKeys (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DateTimePicker.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0