ComboBoxCellType有一个属性AutoCompleteMode,可以设置自动检索的模式,此外还可以结合ComboBoxCellType的AutoCompleteSource或者AutoCompleteCustomSource属性等一块完成自动检索功能
- AutoCompleteStringCollection acsc = new AutoCompleteStringCollection();
- acsc.AddRange(new string[]{"One", "Two", "Three", "Four"});
- FarPoint.Win.Spread.CellType.ComboBoxCellType cb = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
- cb.Items = new string[]{"One", "Two", "Three", "Four"};
- cb.Editable = true;
- cb.AutoCompleteCustomSource = acsc;
- cb.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
- cb.AutoCompleteSource = AutoCompleteSource.CustomSource;
复制代码 |