上一行的代码,参考
Dim obj As object = Forms("窗口2").Controls("PictureViewer1").basecontrol.Controls(0)
Dim pic As Object = obj.panel1.controls("PictureSplitContainer").Panel1.controls("panel2").controls("C1PictureBox1")
Dim r As Row = Tables("表A").current
Dim ls As List(Of String) = r.DataRow.Lines("第一列")
Dim piv As WinForm.PictureViewer = Forms("窗口2").Controls("PictureViewer1")
Dim str As String = FileSys.GetName(piv.SelectedItem)
If vars("str") <> str Then
vars("str") = str
vars("idx") = -1
End If
If vars("idx") = -1 Then
For i As Integer = 0 To ls.count-1
If ls(i).Contains(vars("str")) Then
If i = ls.count-1 Then
pic.image = getimage(ProjectPath & "attachments/" & ls(0))
vars("idx") = 0
Else
pic.image = getimage(ProjectPath & "attachments/" & ls(i+1))
vars("idx") = i+1
End If
End If
Next
ElseIf vars("idx") = ls.count-1
pic.image = getimage(ProjectPath & "attachments/" & ls(0))
vars("idx") = 0
Else
pic.image = getimage(ProjectPath & "attachments/" & ls(vars("idx")+1))
vars("idx") += 1
End If