VB6中MSFlexGrid控件下拉条的使用
比如3*3的表格
A1,A2,A3
B1,B2,B3
C1,C2,C3
我想把B2初始化成下拉的combo形式,list为(1,2,3)
同时把C3初始化成下拉的combo形式,list为(a,b,c)
有方法么?最好有例子 vb6 MSFlexGrid 下拉条
[解决办法]
Private Sub Form_Load()
Dim i As Integer
With MSFlexGrid1
.Cols = 3
.Rows = 1
.FixedCols = 0
.AddItem "A1" & vbTab & "A2" & vbTab & "A3", 1
.AddItem "B1" & vbTab & "B2" & vbTab & "B3", 2
.AddItem "C1" & vbTab & "C2" & vbTab & "C3", 3
For i = 0 To 2
.ColWidth(i) = Combo1.Width + 40
.RowHeight(i + 1) = Combo1.Height
Combo1.AddItem i + 1
Combo2.AddItem Chr(65 + i)
Next i
Combo1.ListIndex = 0
Combo2.ListIndex = 0
.Col = 1
.Row = 2
Combo1.Left = .Left + .CellLeft + 10
Combo1.Top = .Top + .CellTop
.Col = 2
.Row = 3
Combo2.Left = .Left + .CellLeft + 10
Combo2.Top = .Top + .CellTop
End With
End Sub