Browse Source

Update TextBox.cs

pull/3572/head
Symbai 7 years ago
parent
commit
5ad2b362df
  1. 11
      src/Avalonia.Controls/TextBox.cs

11
src/Avalonia.Controls/TextBox.cs

@ -316,8 +316,7 @@ namespace Avalonia.Controls
!AcceptsReturn &&
Text?.Length > 0)
{
SelectionStart = 0;
SelectionEnd = Text.Length;
SelectAll();
}
else
{
@ -673,8 +672,7 @@ namespace Avalonia.Controls
SelectionEnd = StringUtils.NextWord(text, index);
break;
case 3:
SelectionStart = 0;
SelectionEnd = text.Length;
SelectAll();
break;
}
}
@ -896,7 +894,10 @@ namespace Avalonia.Controls
CaretIndex = caretIndex;
}
private void SelectAll()
/// <summary>
/// Select all text in the TextBox
/// </summary>
public void SelectAll()
{
SelectionStart = 0;
SelectionEnd = Text?.Length ?? 0;

Loading…
Cancel
Save