c# - Search through Tab Control for specific Tab Item based on a String value -


i know how select tabitem in tabcontrol name matches specific string value. i'm guessing have sort of search.

here's visual example:

string selectedtabitem = "tabitem";  //if there exists tab item in specific tab control //with above string it's name //that tab item .isselected = true; 

assuming create tabs manually, , not via bindings, should work:

tabcontrol.selecteditem = tabcontrol.items.oftype<tabitem>().singleordefault(n => n.name == selectedtabitem); 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -