문제

Say I have a ComboBox, like so:

<ComboBox IsEditable="True" Height="30">
    <ComboBoxItem>robot</ComboBoxItem>
    <ComboBoxItem>Robot</ComboBoxItem>
</ComboBox>

If a user comes along and starts by typing a lower-case r into that ComboBox when it is empty, the ComboBox predictably auto-fills itself with the word robot. Great.

Now the same user comes along and starts typing an upper-case R into that ComboBox when it is again empty. Unpredictable, the ComboBox auto-fills itself with the lower-case word robot. Not great. I desperately want it to auto-fill itself with Robot, but WPF does not seem to want to smile down upon me.

No matter what you do (CAPS lock, shift+key), the ComboBox will always auto-fill with the lower case robot, provided that the lower case robot precedes the upper case Robot in the ComboBox's items collection.

Is there any way to prevent this? This behavior is maddening and makes for an absolutely abysmal user experience.

도움이 되었습니까?

해결책

In .Net 4 you can set IsTextSearchCaseSensitive=True on the ComboBox (or indeed any ItemsControl)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top