Rockstart
Rockstart

Reputation: 2377

Direction button not working in WPF Combo box

I have a WPF Combo Box which is editable by setting

IsEditable="True"

When the focus is on the text box in the combo and when I click on down arrow, it does not go to the first item in the drop down list. How do I do that?

Upvotes: 0

Views: 277

Answers (1)

Sheridan
Sheridan

Reputation: 69989

The behaviour that you describe is the default behaviour of the ComboBox. If you have a ComboBox that does not display this behaviour, I suggest to you that it is your code that is stopping it. If you use this simple example, you will see that this ComboBox works as you wanted:

<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
    <ComboBox IsEditable="True" Height="25">
        <ComboBoxItem>Item one</ComboBoxItem>
        <ComboBoxItem>Item two</ComboBoxItem>
        <ComboBoxItem>Item three</ComboBoxItem>
        <ComboBoxItem>Item four</ComboBoxItem>
    </ComboBox>
    <TextBox HorizontalAlignment="Center" Width="100" Margin="0,5,0,0" />
</StackPanel>

The TextBox is just there so we can tab off the ComboBox and back on again. It all works as expected.

Upvotes: 1

Related Questions