diff --git a/Perspex.Controls/TextBox.cs b/Perspex.Controls/TextBox.cs index ef67754ada..ace2a13d13 100644 --- a/Perspex.Controls/TextBox.cs +++ b/Perspex.Controls/TextBox.cs @@ -256,7 +256,6 @@ namespace Perspex.Controls return false; } } - private void OnKeyDown(object sender, KeyEventArgs e) { string text = this.Text ?? string.Empty; @@ -267,6 +266,14 @@ namespace Perspex.Controls switch (e.Key) { + case Key.A: + if (modifiers == ModifierKeys.Control) + { + this.SelectionStart = 0; + this.SelectionEnd = this.Text.Length; + } + + break; case Key.Left: this.MoveHorizontal(-1, modifiers); movement = true; diff --git a/Perspex.Controls/TextBoxView.cs b/Perspex.Controls/TextBoxView.cs index 8bf1bc024b..15ccc0fbfd 100644 --- a/Perspex.Controls/TextBoxView.cs +++ b/Perspex.Controls/TextBoxView.cs @@ -55,6 +55,9 @@ namespace Perspex.Controls public new void LostFocus() { + this.parent.SelectionStart = 0; + this.parent.SelectionEnd = 0; + this.caretTimer.Stop(); this.InvalidateVisual(); }