How get Event "item Selected" with AutoComplete in C#? -
How get Event "item Selected" with AutoComplete in C#? -
i have code "autocompletestringcollection"
private void txts_textchanged(object sender, eventargs e) { textbox t = sender textbox; string[] arr = this.dbservice.getall(); if (t != null) { if (t.text.length >= 3) { autocompletestringcollection collection = new autocompletestringcollection(); collection.addrange(arr); this.txtserial.autocompletecustomsource = collection; } } }
but how can event "item selected" after user selects autocomplete suggestion? , value of field?
there's no such thing chosen item event textbox, believe you're using autocomplete. add together key downwards event textbox. there verify if come in key pressed (clicking on suggested link same pressing enter). that:
private void textbox1_keydown(object sender, keyeventargs e) { if (e.keydata == keys.enter) { string selitem = this.textbox1.text; } }
c# autocomplete
Comments
Post a Comment