using System; using SystemCollectionsGeneric; using SystemText; namespace winform { public class OurComBox : SystemWindowsFormsComboBox { //==============overwrite ComboBox OnkeyUp method protected override void OnKeyUp(SystemWindowsFormsKeyEventArgs e) { foreach (object item in thisItems) { string[] strs = itemToString()Split(ToCharArray());//利用空格来分格字符串 if (strs[]Trim()Equals(thisText))//如果输入的值等于前面的编号 { thisSelectedItem = item; thisSelectAll(); } } baseOnKeyUp(e); } //================= } } |