Ignore accents in autocomplete system.windows.forms.TextBox

I use a text box with built-in autocomplete.

this.textBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; this.textBox.AutoCompleteSource = AutoCompleteSource.CustomSource; this.textBox.AutoCompleteCustomSource = listSource; 

listSource is an AutoCompleteStringCollection with my string inputs. Some meanings begin with accent letters like Š or Č.

If I find 'S', I also want to get all the elements starting with 'Š'.

Is it possible?

+4
source share
1 answer

I believe that what you ask for is impossible.

However, you could overcome this problem by converting inconsistent letters to accented letters, then running autocomplete on both accented and inconsistent letters. (Or vice versa)

It would be a bit uncomfortable workaround, but it might work.

Alternatively, you can extract all the accents from the list, but I would suggest that it would be useless.

Otherwise, no. You will need to write your own code to perform this function.

0
source

Source: https://habr.com/ru/post/1392972/


All Articles