listbox1中有(1,2,4,)listbox2中有(1,3) 一个button按钮。如何实现listbox3中出现相同的数字(1),listbox4中出现(2,4,),listbox5中出现(3)
会写其中相同的数字。
Dim i As Integer
Dim j As Integer
Dim ss
Dim bb
For i = 0 To ListBox1.Items.Count - 1
For j = 0 To ListBox2.Items.Count - 1
ss = ListBox1.Items(i)
bb = ListBox2.Items(j)
If ss = bb Then
ListBox3.Items.Add(ss)
End If
Next j
Next i
会写其中相同的数字。
Dim i As Integer
Dim j As Integer
Dim ss
Dim bb
For i = 0 To ListBox1.Items.Count - 1
For j = 0 To ListBox2.Items.Count - 1
ss = ListBox1.Items(i)
bb = ListBox2.Items(j)
If ss = bb Then
ListBox3.Items.Add(ss)
End If
Next j
Next i
解决方案 »
- 打包要连DBF数据库的VB程序需要注册些什么?
- spread控件的问题:设置了行选中后如何防止双击选中单元格?
- ID为xzdgy的好像只那个.频繁的在回俺的贴.
- 具有查询功能的comboBox
- 关于Richtextbox的一个奇怪的问题,请高手帮忙!!非常急,24小时在线等!顶着有分
- 如何编写反安装程序?(即程序自己把自己从硬盘删除?)
- 如何将数据存入数据库中
- 画坐标轴问题
- 请指教,怎样才能在VB中实现对ACCESS数据库的压缩和修复操作。
- 图表的问题
- 我想求一个VB科学计算器代码,只要实现数字0-9 四则运算 平方以及平方根 sin cos 退格 复制 粘贴 清除 倒数 求和 平均值的就行,可以帮我么
- vb recordset问题 大神速来~~在线等
Private Declare Function SendMessagebyString Lib "user32" Alias "SendMessageA" (ByVal hWND As Long, _
ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As LongPrivate Const LB_FINDSTRINGEXACT = &H1A2Private Sub Command1_Click()
Dim i As Long
List3.Clear
List4.Clear
For i = 0 To List1.ListCount - 1
If -1 = SendMessagebyString(List2.hWND, LB_FINDSTRINGEXACT, -1, List1.List(i)) Then
List4.AddItem List1.List(i)
Else
List3.AddItem List1.List(i)
End If
Next i
List5.Clear
For i = 0 To List2.ListCount - 1
If -1 = SendMessagebyString(List3.hWND, LB_FINDSTRINGEXACT, -1, List2.List(i)) Then
List5.AddItem List2.List(i)
End If
Next i
End Sub