It's really simple, as long as you set the attached property focusmanager.isfocusscope in the container control to True .
The following is a simple use case:
<window x:class="Wpfapplication1.mainwindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="Http://schemas.microsoft.com/winfx/2006/xaml"Title="MainWindow"height=" -"Width="525"> <Grid> <Grid.RowDefinitions> <rowdefinition height=" -"/> <rowdefinition height="*"/> </Grid.RowDefinitions> <stackpanel grid.row="0"orientation="Horizontal"Focusmanager.isfocusscope="True"> <combobox width=" -"> <ComboBoxItem>1</ComboBoxItem> <ComboBoxItem>2</ComboBoxItem> <ComboBoxItem>3</ComboBoxItem> </ComboBox> <combobox width=" -"> <ComboBoxItem>a</ComboBoxItem> <ComboBoxItem>b</ComboBoxItem> <ComboBoxItem>c</ComboBoxItem> </ComboBox> </StackPanel> &L T RichTextBox grid.row="1"/> </Grid></Window>
The following is a run
about how to keep highlighting selected when RichTextBox loses focus in WPF