WPF Keyboard Navigation - Set element as focused
Hey, I want to ask how may I set element as focused on start? When I generate view I have to click some times "Right arrow" to have focused any element. Can I set on start for example first element?
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: WPF Keyboard Navigation - Set element as focused
You can use a trigger for Loaded event to set the focus on any element:
Code: Select all
<Button Content="Button">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<noesis:SetFocusAction/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
Re: WPF Keyboard Navigation - Set element as focused
Yes, thanks that worked :)
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: WPF Keyboard Navigation - Set element as focused
Great, marking this as solved.
Who is online
Users browsing this forum: No registered users and 10 guests