Browse Source

Make sure to only use characters that make up a number when parsing the value for a numeric up/down

pull/1789/head
Simon Ensslen 1 year ago
parent
commit
1e2697c305
  1. 5
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Implementation/CommonNumericUpDown.cs

5
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Implementation/CommonNumericUpDown.cs

@ -19,6 +19,7 @@ using System.Windows;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace Xceed.Wpf.Toolkit
{
@ -262,7 +263,9 @@ namespace Xceed.Wpf.Toolkit
return this.Value;
}
result = this.ConvertTextToValueCore( currentValueText, text );
var cleanedText = Regex.Replace(text, "[^0-9.,]", "", RegexOptions.Compiled, TimeSpan.FromMilliseconds(100));
result = this.ConvertTextToValueCore( currentValueText, cleanedText );
if( this.ClipValueToMinMax )
{

Loading…
Cancel
Save