Skip to content

Commit

Permalink
Issue MahApps#2370
Browse files Browse the repository at this point in the history
Fixed up the pasting into the NumericUpDown control so that selected
text is replaced.
  • Loading branch information
michaelprewecki committed Feb 24, 2016
1 parent 8b2f248 commit 0b55be5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MahApps.Metro/Controls/NumericUpDown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ private void OnValueTextBoxPaste(object sender, DataObjectPastingEventArgs e)

var text = e.SourceDataObject.GetData(DataFormats.Text) as string;

string newText = string.Concat(textPresent.Substring(0, textBox.SelectionStart), text, textPresent.Substring(textBox.SelectionStart));
string newText = string.Concat(textPresent.Substring(0, textBox.SelectionStart), text, textPresent.Substring(textBox.SelectionStart + textBox.SelectionLength));
double number;
if (!ValidateText(newText, out number))
{
Expand Down

0 comments on commit 0b55be5

Please sign in to comment.