Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

When check the CheckBox, getting focus problem

$
0
0

Hi,

I am testing of Check and Unchecked of CheckBox, but when I try to Check or UnCheck the CheckBox, focus goes to TabItem instead of CheckBox.

XAML is here.

<Window x:Class="TextBox_Focus.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525"><DockPanel><Menu DockPanel.Dock="Top"><MenuItem Header="Startup"></MenuItem><MenuItem Header="Setup"></MenuItem><MenuItem Header="Transaction"></MenuItem></Menu><ToolBarTray DockPanel.Dock="Top" ><ToolBar KeyboardNavigation.TabNavigation="Once"><Button Content="Add"></Button><Button Content="Edit"></Button><Button Content="Delete"></Button></ToolBar></ToolBarTray><TabControl Name="tabMain"><TabItem Header="Tab 1" ><StackPanel  FocusManager.IsFocusScope="True"><TextBox></TextBox><CheckBox Content="Testing 1"></CheckBox><CheckBox Content="Testing 2"></CheckBox><CheckBox Content="Testing 3"></CheckBox></StackPanel></TabItem><TabItem Header="Tab 2" ><StackPanel  FocusManager.IsFocusScope="True"><TextBox></TextBox><CheckBox Content="Testing 1"></CheckBox><CheckBox Content="Testing 2"></CheckBox><CheckBox Content="Testing 3"></CheckBox></StackPanel></TabItem></TabControl></DockPanel></Window>



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>