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.

import/raw
brianlagunas_cp 15 years ago
parent
commit
59b8320a50
  1. 3
      Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Implementation/MaskedTextBox.cs

3
Main/Source/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 (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))
UpdateText(provider, position);

Loading…
Cancel
Save