vb 我想从text1查找text2的内容并把找到内容的那一行显示到text3
text1是多行文本text2为查询内容一个按钮点击一下按钮查询text1的内容把所有与text2内容形同的那一行显示在text3请直接给出源码谢谢各路大神...
text1是多行文本 text2为查询内容 一个按钮点击一下按钮 查询text1的内容把所有与text2内容形同的那一行显示在text3
请直接给出源码谢谢各路大神 展开
请直接给出源码谢谢各路大神 展开
1个回答
2015-10-06
展开全部
Option Explicit
Private Sub Command1_Click()
Dim myLine1() As String, myLine2() As String, i As Integer, j As Integer
myLine1 = Split(Text1.Text, vbCrLf)
myLine2 = Split(Text2.Text, vbCrLf)
Text3.Text = ""
For i = 0 To UBound(myLine2)
For j = 0 To UBound(myLine1)
' If InStr(1, myLine1(j), myLine2(i)) Then Text3.Text = Text3.Text & myLine1(j) & vbCrLf
If myLine2(i) = myLine1(j) Then Text3.Text = Text3.Text & myLine1(j) & vbCrLf
Next
Next
End Sub
Private Sub Command1_Click()
Dim myLine1() As String, myLine2() As String, i As Integer, j As Integer
myLine1 = Split(Text1.Text, vbCrLf)
myLine2 = Split(Text2.Text, vbCrLf)
Text3.Text = ""
For i = 0 To UBound(myLine2)
For j = 0 To UBound(myLine1)
' If InStr(1, myLine1(j), myLine2(i)) Then Text3.Text = Text3.Text & myLine1(j) & vbCrLf
If myLine2(i) = myLine1(j) Then Text3.Text = Text3.Text & myLine1(j) & vbCrLf
Next
Next
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询