ComboBox AutoComplete Custom Capabilities

后端 未结 2 1937
再見小時候
再見小時候 2020-12-21 15:59

How can I extend the AutoComplete feature of a WinForm ComboBox to, for example, find matches of items using a regular expression or for simplicity to find items that contai

2条回答
  •  轮回少年
    2020-12-21 16:35

    For finding the existing list item that best matches what the user has typed, you can set the AutoCompleteMode property on the ComboBox to AutoCompleteMode.Append and the AutoCompleteSource to AutoCompleteSource.ListItems.

    If you want to use more complex logic to perform the auto-complete, look at doing something with the TextChanged event. An Example

提交回复
热议问题