Private Sub VSFlexGrid1_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean) If Row = 10 Then VSFlexGrid1.ComboList = "|234|235" Else VSFlexGrid1.ComboList = "123|124" End If End Sub colcombolist 一样
To edit the cell using a drop-down list, set the ComboList property to a string containing the available options, separated by pipe characters ("|"). For example: ComboList = "ListItem 1|ListItem 2".To edit the cell using a drop-down combo, set the ComboList property to a string containing the available options, separated by pipe characters ("|") and starting with a pipe character. For example: ComboList = "|ComboItem 1|ComboItem 2".
非ColComboList(ColIndex)
If Row = 10 Then
VSFlexGrid1.ComboList = "|234|235"
Else
VSFlexGrid1.ComboList = "123|124"
End If
End Sub
colcombolist 一样
这样还是不支持text内容的修改呀,只能通过鼠标选择list的项。
combobox控件有Style属性,0为可修改text内容,2为不可修改text内容。好像vsflexgrid的combox没法设置这个属性。
.Editable = flexEDKbdMouse
.ComboList = "|#10*1;Getz" & vbTab & "Stan" & vbTab & "1 Sansome" & vbTab & "972-4323" & _
"|#20;Mindelis" & vbTab & "Nuno" & vbTab & "2 5th" & vbTab & "972-2321" & _
"|#30;Davis" & vbTab & "Miles" & vbTab & "1 High" & vbTab & "345-2342" & _
"|#40;Johnson" & vbTab & "Bob" & vbTab & "5 Hemlock" & vbTab & "342-2321" .ShowComboButton = flexSBFocus .ComboSearch = flexCmbSearchLists '作用于drop-down lists
终于知道怎么进行编辑了:如果 .ColComboList(1)="str1|str2|str3",那么这个列combox的text是不可修改的;如果如果 .ColComboList(1)="|str1|str2|str3",那么这列combox的text就是可以修改的,太神奇了!!!区别在于赋值的字符串前有没有"|",怎么说明中就没有提到呢!!!
ColComboList属性中确实没有提到,ComboList里面提到了.
我1楼说法有误,都可以的.