Public partial class page: usercontrol {public page () {// The initializecomponent () variable needs to be initialized; cmbs_items_add () ;}public class combitem {public string value {Get; set ;} public String text {Get; Set ;}/// <summary> /// assign a value to combox /// </Summary> private void cmbs_items_add () {// assign this to the house id. CMBS. updatelayout (); // set this. CMBS. updatelayout (); ensure that all sub-object locations of the uielement are correctly configured with the layout update list <combitem> CTG = new list <combitem> () {New combitem {value = "", TEXT = ""}, new combitem {value = "0", text = "normal"}, new combitem {value = "1", text = "new "}, new combitem {value = "2", text = "split" }}; this. CMBS. itemssource = CTG; CMBS. displaymemberpath = "text"; // bind the text value this. CMBS. selectedvaluepath = "value "; // specify the value} # region ========= set the current selection item ======= combitem EMP = new combitem () {value = "", text = ""}; // This. combobox1.selecteditem = EMP; // This setting does not work. list <combitem> List = This. CMBS. itemssource as list <combitem>; int flag =-1; for (INT I = 0; I <list. count; I ++) {If (list [I]. value = EMP. value & list [I]. TEXT = EMP. text) {flag = I; break;} This. CMBS. selectedindex = flag; # endregion // obtain the combox selected value combitem EMP = This. CMBS. selecteditem as combitem ;}