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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -