Skip to content

Commit

Permalink
select all when address bar got focus
Browse files Browse the repository at this point in the history
  • Loading branch information
haojiezhe12345 committed Feb 27, 2024
1 parent acbc93a commit 378b4dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<Button Grid.Column="2" Margin="3" Click="refresh">
<SymbolIcon x:Name="refreshBtnSym" Symbol="Refresh"/>
</Button>
<TextBox x:Name="address" Grid.Column="3" Margin="3" TextWrapping="NoWrap" Text="http://" KeyDown="address_KeyDown" />
<TextBox x:Name="address" Grid.Column="3" Margin="3" TextWrapping="NoWrap" Text="http://" KeyDown="address_KeyDown" GotFocus="address_GotFocus" />
<Button Grid.Column="4" Margin="3" Click="go">
<SymbolIcon Symbol="Forward"/>
</Button>
Expand Down
5 changes: 5 additions & 0 deletions MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,10 @@ private void webview_NewWindowRequested(WebView sender, WebViewNewWindowRequeste
args.Handled = true;
} catch { }
}

private void address_GotFocus(object sender, RoutedEventArgs e)
{
address.SelectAll();
}
}
}

0 comments on commit 378b4dc

Please sign in to comment.