From 6e38685531daa92a0ad023bb765a29db6788a59d Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Thu, 26 May 2022 07:50:23 +0200 Subject: [PATCH] Catch any exception on formatting (this here was OutOfRange) --- ENI2/DetailBaseControl.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ENI2/DetailBaseControl.cs b/ENI2/DetailBaseControl.cs index 05f5c214..b1c00860 100644 --- a/ENI2/DetailBaseControl.cs +++ b/ENI2/DetailBaseControl.cs @@ -267,7 +267,7 @@ namespace ENI2 #region "BHV Spezial" Datetime Parsing.. protected void DateTimePicker_PreviewKeyUp(object sender, System.Windows.Input.KeyEventArgs e) - { + { if ((sender is DateTimePicker thePicker) && rdt.IsMatch(thePicker.Text)) { try @@ -280,7 +280,7 @@ namespace ENI2 int minute = Int32.Parse(timevalText.Substring(10, 2)); thePicker.Value = new DateTime(year, month, day, hour, minute, 0); } - catch (FormatException) { } + catch (Exception) { } } }