vb6 中 microsoft forms 2.0 object library combobox如何实现多列下拉框?
1个回答
展开全部
Private Sub Form_Load()
Dim MyArray(5, 2)
Dim i As Single
'第一个列表框包含三个数据列
ComboBox1.ColumnCount = 3
'第二个框包含六个数据列
ComboBox2.ColumnCount = 6
'把整数值加载到 MyArray 的第一列
For i = 0 To 5
MyArray(i, 0) = i
Next i
'加载 MyArray 的列 2 和列 3
MyArray(0, 1) = "Zero"
MyArray(1, 1) = "One"
MyArray(2, 1) = "Two"
MyArray(3, 1) = "Three"
MyArray(4, 1) = "Four"
MyArray(5, 1) = "Five"
MyArray(0, 2) = "Zero"
MyArray(1, 2) = "Un ou Une"
MyArray(2, 2) = "Deux"
MyArray(3, 2) = "Trois"
MyArray(4, 2) = "Quatre"
MyArray(5, 2) = "Cinq"
'把数据加载到 ListBox1 和 ListBox2
ComboBox1.List() = MyArray
ComboBox2.Column() = MyArray
End Sub
Dim MyArray(5, 2)
Dim i As Single
'第一个列表框包含三个数据列
ComboBox1.ColumnCount = 3
'第二个框包含六个数据列
ComboBox2.ColumnCount = 6
'把整数值加载到 MyArray 的第一列
For i = 0 To 5
MyArray(i, 0) = i
Next i
'加载 MyArray 的列 2 和列 3
MyArray(0, 1) = "Zero"
MyArray(1, 1) = "One"
MyArray(2, 1) = "Two"
MyArray(3, 1) = "Three"
MyArray(4, 1) = "Four"
MyArray(5, 1) = "Five"
MyArray(0, 2) = "Zero"
MyArray(1, 2) = "Un ou Une"
MyArray(2, 2) = "Deux"
MyArray(3, 2) = "Trois"
MyArray(4, 2) = "Quatre"
MyArray(5, 2) = "Cinq"
'把数据加载到 ListBox1 和 ListBox2
ComboBox1.List() = MyArray
ComboBox2.Column() = MyArray
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询