以下是引用有点甜在2014-6-26 23:04:00的发言:
具体说一下吧。
遍历集合,添加入另一个集合
谢谢指点,完成
代码如下:
’选择不同的行,把已收文部门 在文本框中显示,虽实现,但屏幕会闪一下
Dim tb As WinForm.Table = e.Form.Controls("Table1")
Dim text As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim sw() As String = tb.Table.Current("已收文部门").Split(",") ‘已收文部门是多值字段
If e.Table.Current Is Nothing Then
text.Value = ""
End If
If e.Table.Current IsNot Nothing Then
text.Value = ""
Dim lst,lst1 As New List(Of String )
lst1.AddRange(sw) '转为集合
For Each i As String In lst1
If lst.Contains(i) = False Then
lst.Add(i)
End If
Next
For i As Integer = 0 To lst.Count -1
text.Value + = lst(i) & vbcrlf
Next
End If