你是想要一个类似于下拉框的功能吧,可以通过设置CellType = CellTypeComboBox来实现:- ' Specify a cell
- fpSpread1.Row = 2
- fpSpread1.Col = 2
- ' Define cell type as combo box
- fpSpread1.CellType = CellTypeComboBox
- ' Specify text for the combo box
- fpSpread1.TypeComboBoxList = "Mastiff" + Chr$(9) + "Sheepdog"+ Chr$(9) + "Terrier" + Chr$(9) + "Spaniel" + Chr$(9)+ "Pointer" + Chr$(9) + "Coonhound"
- ' Allow the user to edit the list
- fpSpread1.TypeComboBoxEditable = True
- ' Set the number or rows to display
- fpSpread1.TypeComboBoxMaxDrop = 3
- ' Select the first item in the list
- fpSpread1.TypeComboBoxCurSel = 0
- ' Set the width to display the widest item in the list
- fpSpread1.TypeComboBoxWidth = 1
复制代码
|