How to set the first focus on a textbox when window loaded in WPF C#

1 Answer

0 votes
<Window x:Name="mainwindow" x:Class="projectname.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        ...
        FocusManager.FocusedElement="{Binding ElementName=mytextbox}">
    <Grid>
        <TextBox x:Name="mytextbox" ... />
    </Grid>
</Window>

 



answered Dec 26, 2016 by avibootz

Related questions

2 answers 469 views
1 answer 323 views
1 answer 146 views
1 answer 137 views
137 views asked Aug 16, 2023 by avibootz
1 answer 270 views
3 answers 496 views
...