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
解决方案 »
- 散分,散分,庆祝我的图层功能几本能实现了!!!!!!
- 如何处理程序暂时僵死的问题?
- Excel的计算问题.急求各位大侠!!!!
- 请问如何将DATAGRID中的一列设为只读?
- 怎么识别用户输入的表达式
- 三层结构的局域网系统,技术关键是什么?最简单的实施方法是什么?
- data控件问题??急
- 各位CSDN上的朋友,一个时间转换问题!
- 急急。。。馬上就要﹐請各位大蝦求救﹗﹗﹗
- 奇怪!修改DataGrid的值,导致多步操作错误
- 我想求一个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