Dim i As Integer
Dim lb As new List(of String)
Dim drs As new List(of DataRow)
If e.Form.Controls("TextBox1").text = "" Then
e.Form.Controls("TextBox1").text = e.sender.text
Else
e.Form.Controls("TextBox1").text = e.Form.Controls("TextBox1").text & vbcrlf & e.sender.text
End If
For i = 1 To 15
e.Form.Controls("" & i & "").text = ""
Next
Dim txm As new List(of String)
If e.Form.Controls("GroupBox1").text = "选择药品属性" Then
For Each tx As String In e.Form.Controls("TextBox1").lines
txm.add(tx)
Next
For Each dr As DataRow In DataTables("兽药品种库").DataRows
If dr.lines("药品类别").contains(txm(0))= True Then
drs.add(dr)
End If
Next
If txm.count > 1 Then
For i = drs.count-1 To 0 Step -1
For Each tx As String In txm
If drs(i).lines("药品类别").Contains(tx) = False Then
drs.Removeat(i)
End If
Next
Next
End If
For Each dr3 As DataRow In drs
For Each drm As String In dr3.lines("药品类别")
If txm.contains(drm) = False AndAlso lb.contains(drm) = False Then
lb.add(drm)
End If
Next
Next
额就是一个递进 的 find 选项。 但是我的 row 的内容是分行的。