我可以使用下面的代码在单元格中获取下拉菜单
Interop.Range validationAddressRange = ws.Worksheet.get_Range(startAddress, endAddress);
validationAddressRange.Select();
validationAddressRange.Cells.Validation.Delete();
validationAddressRange.Cells.Validation.Add(Type: Interop.XlDVType.xlValidateList,
AlertStyle: Interop.XlDVAlertStyle.xlValidAlertStop, Formula1: formula);
validationAddressRange.Cells.Validation.IgnoreBlank = true;
validationAddressRange.Cells.Validation.InCellDropdown = true;
validationAddressRange.Cells.Validation.ErrorMessage = "Invalid entry. Click 'Retry' to update the cell value, or 'Cancel' to undo the change made to the cell.";
validationAddressRange.Cells.Validation.ErrorTitle = "Invalid Data Error";
validationAddressRange.Cells.Validation.ShowError = true;
ws.Worksheet.Cells[1,1].Select(); //selects the top-leftmost cell since excel doesn't furnish a de-select option.
有谁知道如何绑定事件并具有自动完成功能,就像常规的 Windows 表单组合框一样?