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 -

Python Tornado package error when running server -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -