Browse Source

MaskedTextBox: fixed focus issue that I fixed a long time ago but somehow re-intorduced.

pull/1645/head
brianlagunas_cp 16 years ago
parent
commit
4a5f0601bd
  1. 21
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Implementation/MaskedTextBox.cs

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

@ -334,8 +334,6 @@ namespace Microsoft.Windows.Controls
}; };
} }
#endregion //Private
private object ConvertTextToValue(string text) private object ConvertTextToValue(string text)
{ {
object convertedValue = null; object convertedValue = null;
@ -380,7 +378,7 @@ namespace Microsoft.Windows.Controls
return MaskProvider.ToDisplayString(); return MaskProvider.ToDisplayString();
} }
protected void SyncTextAndValueProperties(DependencyProperty p, object newValue) private void SyncTextAndValueProperties(DependencyProperty p, object newValue)
{ {
//prevents recursive syncing properties //prevents recursive syncing properties
if (_isSyncingTextAndValueProperties) if (_isSyncingTextAndValueProperties)
@ -400,6 +398,23 @@ namespace Microsoft.Windows.Controls
_isSyncingTextAndValueProperties = false; _isSyncingTextAndValueProperties = false;
} }
#endregion //Private
#region Public
/// <summary>
/// Attempts to set focus to this element.
/// </summary>
public new void Focus()
{
if (TextBox != null)
TextBox.Focus();
else
base.Focus();
}
#endregion //Public
#endregion //Methods #endregion //Methods
#region Commands #region Commands

Loading…
Cancel
Save