测试了一下,无法控制pictureviewer控件的,即便控制了,也会造成不同步的情况出现。
If e.keycode = Keys.left Then
Dim obj As object = Forms("窗口1").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 = e.Form.Controls("PictureViewer1")
Dim str As String = FileSys.GetName(piv.SelectedItem)
If vars("i") = 0 Then
For i As Integer = 0 To ls.count-1
If ls(i).Contains(str) Then
If i > 0 Then
pic.image = getimage(ProjectPath & "attachments/" & ls(i-1))
vars("i") = i-1
End If
End If
Next
Else
pic.image = getimage(ProjectPath & "attachments/" & ls(vars("i")-1))
vars("i") -= 1
End If
e.cancel = True
ElseIf e.keycode = Keys.right Then
e.cancel = True
End If
放弃这个想法吧。如果要做,建议自己做一个picturebox来显示图片