Browse Source

MaskedTextBox: implemented feature when all text is selected and user types a new value, all text is deleted and the new value is entered in its place.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
90605c1fd5
  1. 7
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Implementation/MaskedTextBox.cs

7
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Implementation/MaskedTextBox.cs

@ -339,6 +339,13 @@ namespace Microsoft.Windows.Controls
e.Handled = true;
}
//if all text is selected and the user begins to type, we want to delete all selected text and continue typing the new values
if (SelectionLength == Text.Length)
{
if (provider.RemoveAt(position, endposition))
UpdateText(provider, position);
}
base.OnPreviewKeyDown(e);
}

Loading…
Cancel
Save