Dim lvws() As Winform.ListView = {lvw1,lvw2,lvw3,lvw4,lvw5,lvw6,lvw7} For Each lvw As WinForm.ListView In lvws Dim vr As WinForm.ListViewRow = lvw.Current '获取ListView的当前行 If vr Is Nothing Then '如果不存在当前行,也就是内有选定任何一行 Continue For End If Dim dr As DataRow = vr.tag '获取此行对应的DataRow Dim ps As Integer = Tables("主窗口").FindRow(dr) If ps >= 0 Then Tables("主窗口").Position = ps Forms("保养维护记录窗口").Open For Each cl As WinForm.ListViewColumn In lvw.Columns '逐列更新值 vr(cl.Name) = dr(cl.Name) Next End If Next
|