combox 用法
如何使combox单击一项,按一添加按钮,然后添加上之后,combox单击的那一项就被删除了~各位大虾,求助了~~~帮帮忙。--------------------编程问答-------------------- 是这个意思么?
Option Explicit--------------------编程问答-------------------- 多谢大侠关注,现在我就是想往数据表里添加combox里的数据,combox里有“张三”“李四”“王五”等项,然后我选中张三,按添加按钮后,添加到了数据表里了,同时张三这项,也在combox里被删除了。
Private Sub Command1_Click()
Combo1.RemoveItem (Combo1.ListIndex)
Combo1.Refresh
End Sub
Private Sub Form_Load()
Dim i As Byte
For i = 0 To 5
Combo1.AddItem i
Next
End Sub
谢谢帮助~~ --------------------编程问答-------------------- ADO类代码可以实现 --------------------编程问答-------------------- Option Explicit
Private Sub Combo1_Click()
With Combo1
Combo2.AddItem .List(.ListIndex)
.RemoveItem .ListIndex
.Refresh
End With
End Sub
Private Sub Form_Load()
Dim i As Long
With Combo1
For i = 0 To 10
.AddItem "Item" & CStr(i)
Next
End With
End Sub
--------------------编程问答-------------------- 谢谢了,但还是弄不明白~~ --------------------编程问答--------------------
补充:VB , 控件