Place cursor in the end of the name on textbox focus (#12607)

This commit is contained in:
Stefan Markovic 2021-08-04 14:50:32 +02:00 committed by GitHub
parent d106db8061
commit 7751fed39e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -390,7 +390,8 @@
Margin="12,0,0,0"
ui:ControlHelper.Header="{x:Static props:Resources.Name}"
MinWidth="286"
HorizontalAlignment="Stretch" />
HorizontalAlignment="Stretch"
GotKeyboardFocus="TextBox_GotKeyboardFocus"/>
</StackPanel>
<!-- Shortcut panel -->

View file

@ -446,5 +446,11 @@ namespace FancyZonesEditor
}
}
}
private void TextBox_GotKeyboardFocus(object sender, RoutedEventArgs e)
{
TextBox tb = sender as TextBox;
tb.SelectionStart = tb.Text.Length;
}
}
}