c# - How to hide specific item from a combo box in win forms -


how can hide specific number of items combo box. code below hide items instead. couldn't find way perform this

string taskselection = taskselectioncombobox.text; string stateofchild = stateofchildcombobox.text; if (stateofchild == "awake") {     taskselectioncombobox.hide(); } 

you need store items want use remove method delete them. can use add make them back.

// keep items in list list<string> list = new list<string>(); list.add("awake"); // remove them combobox combobox1.items.remove("awake"); // if want add them again. combobox1.items.add(list[0]); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -