Tab ordering in WPF controls.
-
Hi, I want to set the tab order in a windnow which contains ToolBarTray. But it is not setting it. Below is my XAML. <Window x:Class="WpfApplication2.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <TextBox AcceptsTab="False" Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="textBox2" VerticalAlignment="Top" Width="104" KeyboardNavigation.TabIndex="1"/> <Label x:Name="lblName" Height="27" HorizontalAlignment="Left" Margin="26,38,0,0" VerticalAlignment="Top" Width="61" Content="_Name" Target="{Binding ElementName=txtName}"></Label> <TextBox x:Name="txtName" Height="23" Margin="112,38,62,0" VerticalAlignment="Top" KeyboardNavigation.TabIndex="2" /> <ToolBarTray ToolBarTray.IsLocked="True" Margin="4,0,-4,72" Height="55" VerticalAlignment="Bottom"> <ToolBar x:Name="mainToolBar" Background="Transparent"> <Button x:Name="newToolbarButton" KeyboardNavigation.TabIndex="3"> <StackPanel Orientation="Horizontal" Height="16" Width="50" Margin="0" VerticalAlignment="Top" > <Label Content="New" Margin="4,0,0,0" VerticalAlignment="Center" Height="23" Width="37" /> </StackPanel> </Button> <Separator/> <Button x:Name="helpToolbarButton" Margin="0,-1" KeyboardNavigation.TabIndex="4" > <StackPanel Orientation="Horizontal"> <Label Content="Help" Margin="4,0,0,0" VerticalAlignment="Center" /> </StackPanel> </Button> </ToolBar> </ToolBarTray> <Button Height="31" Margin="19.81,0,0,22" Name="button1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="77" KeyboardNavigation.TabIndex="5">Button</Button> <Button Margin="131,0,62,19.75" Name="button2" KeyboardNavigation.TabIndex="6" Height="35.5" VerticalAlignment="Bottom">Button</Button>