NumPad 修复了 官方NumericUpDown对NumPad不响应的问题
NumPad 修复了 当Target不是TextBox的时候,NumPad上的Delete和Back不响应的问题 IPv4Box 修复了 由于失去焦点所以对 NumPad 不响应的问题
This commit is contained in:
@@ -107,7 +107,25 @@ public class IPv4Box: TemplatedControl
|
||||
e.Client = tb._imClient;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <20>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
internal bool IsTargetByNumPad
|
||||
{
|
||||
set
|
||||
{
|
||||
if(_isTargetByNumPad
|
||||
&&!value)
|
||||
{
|
||||
SetLostFocus();
|
||||
}
|
||||
_isTargetByNumPad =value;
|
||||
}
|
||||
get => _isTargetByNumPad;
|
||||
}
|
||||
private bool _isTargetByNumPad;
|
||||
|
||||
#region Overrides
|
||||
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
@@ -308,6 +326,15 @@ public class IPv4Box: TemplatedControl
|
||||
protected override void OnLostFocus(RoutedEventArgs e)
|
||||
{
|
||||
base.OnLostFocus(e);
|
||||
if (IsTargetByNumPad)
|
||||
{
|
||||
return;
|
||||
}
|
||||
SetLostFocus();
|
||||
}
|
||||
|
||||
private void SetLostFocus()
|
||||
{
|
||||
foreach (var pre in _presenters)
|
||||
{
|
||||
pre?.HideCaret();
|
||||
@@ -317,7 +344,8 @@ public class IPv4Box: TemplatedControl
|
||||
ParseBytes(ShowLeadingZero);
|
||||
SetIPAddressInternal();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override void OnGotFocus(GotFocusEventArgs e)
|
||||
{
|
||||
_currentActivePresenter = _firstText;
|
||||
|
||||
Reference in New Issue
Block a user