开发者

Load Combobox items Dynamically on KeyPress

开发者 https://www.devze.com 2023-01-19 01:54 出处:网络
I want to create a combobox like winform control in VB.Net that makes suggestions dynamically; exactly as the address bar does in Google Chrome o开发者_运维知识库r IE 8/9. Basically on each keypress,

I want to create a combobox like winform control in VB.Net that makes suggestions dynamically; exactly as the address bar does in Google Chrome o开发者_运维知识库r IE 8/9. Basically on each keypress, get a list of items that match the entered text on a background thread(s) and show these items in the dropdown list as they are (possibly slowly) returned - either from DB queries, web services etc.

I have tried a couple of ideas, changing the AutoComplete list dynamically or binding to a list, which I then update. But I am getting some rather odd and incorrect results even when updating the list directly (on the main thread). I also tried implementing my own textbox control that shows a ListBox control where the dropdown would appear - this seemed a lot more reliable but I cannot get it to draw over the edge of forms etc when shown, as the combobox drop-down does.

Has any one achieved similar functionality? Where do I start?


This could be what you are looking for: AutoComplete ComboBox in VB.Net

0

精彩评论

暂无评论...
验证码 换一张
取 消