Browse Source

MaskedTextBox: fixed bug that was introduced with new "typing while all text selected overwrites value" feature, where the Tab key would cause the text to be deleted when all text was selected.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
7553284ceb
  1. 3
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Implementation/MaskedTextBox.cs

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

@ -340,7 +340,8 @@ namespace Microsoft.Windows.Controls
} }
//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 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) //but only if the user is not tabbing / shift tabbing
if (SelectionLength == Text.Length && (e.Key != Key.Tab && e.Key != Key.LeftShift && e.Key != Key.RightShift))
{ {
if (provider.RemoveAt(position, endposition)) if (provider.RemoveAt(position, endposition))
UpdateText(provider, position); UpdateText(provider, position);

Loading…
Cancel
Save