Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,842 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have custom control, which is templated like below
Blockquote
<DockPanel>
<local:CustomControl1>
<ToggleButton></ToggleButton>
</local:CustomControl1>
</DockPanel
Blockquote
Problem:
When i press tab key DockPanel can recieves the keyboard focus and but custom control failed to do so. I need to focus the control inside the Custom Control.
Please suggest any solution to resolve this.
Thanks
Maggi
Welcome to our Microsoft Q&A platform!
You can try to add code Focusable="True" in Grid.
<UserControl x:Class="_1.Customcontroldoesnotreceivesthe.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:_1.Customcontroldoesnotreceivesthe"
mc:Ignorable="d"
d:DesignHeight="20" d:DesignWidth="100" >
<Grid Focusable="True">
</Grid>
</UserControl>
Thanks.