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 586 views
1 answer 395 views
1 answer 233 views
1 answer 210 views
210 views asked Aug 16, 2023 by avibootz
1 answer 350 views
3 answers 647 views
...