In WPF, when I type some text in combobox, it will highlight the item starting with the text I entered. This highlighting will search the whole text I have entered in the combo box. But instead I want the text search to match only the first letter. How to do this?
Sample Code to re-create the problem:
XAML:
<Window x:Class="ComboTest.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">
<StackPanel>
<ComboBox x:Name="cb"></ComboBox>
</StackPanel>
</Window>
Code Behind:
namespace ComboTest
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
cb.Items.Add("a");
cb.Items.Add("ab");
cb.Items.Add("abc");
cb.Items.Add("agsf");
cb.Items.Add("b1");
cb.Items.Add("b2");
cb.Items.Add("b3");
cb.Items.Add("b4");
cb.Items.Add("bbb");
cb.Items.Add("bbbbb");
cb.Items.Add("c4");
cb.Items.Add("c");
cb.Items.Add("c1");
cb.Items.Add("c2");
cb.Items.Add("cbb");
cb.Items.Add("cbd");
cb.Items.Add("d");
cb.Items.Add("de");
cb.Items.Add("df");
}
}
}
Now, run the solution, click on the combobox to open the pop up and press a continuously it will circle through all the items starting with a. I want the similar behavior when we press 'B' continiously.