c# - Is there a way to make a drop down menu like this? -


is there know how make drop down menu this?

http://puu.sh/88oll.png

i put in if me:

private void richtextbox1_textchanged(object sender, eventargs e) {     //in here } 

yes , can use listbox control.

or

you can use combobox control setting dropdownstyle property simple.

edit:

if want search string listbox , select item if matching

you need have textbox receive serach string input. 

enter image description here

you need handle textbox key_down event handler start searching.

note: in below code have started searching when user enters enter key after entering input search string.

try this:

private void textbox1_keydown(object sender, keyeventargs e)     {         if (e.keycode == keys.enter)         {             var itemsearched = textbox1.text;             int itemcount = 0;             foreach (var item in listbox1.items)             {                 if (item.tostring().indexof(itemsearched,stringcomparison.invariantcultureignorecase)!=-1)                 {                     listbox1.selectedindex = itemcount;                     break;                 }                  itemcount++;             }         }     } 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -