Since the ListView does not have a scroll event, put each listview into a panel and set the properties of the panels/listviews as below. This uses the panel scroll event to keep the scrollbars aligned with whichever is changed.
Code:
Option Strict On
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
'Put the two listviews into two panels
Panel1.Size = ListView1.Size
Panel2.Size = ListView2.Size
Panel1.AutoScroll = True
Panel2.AutoScroll = True
Panel1.AutoSize = False
Panel2.AutoSize = False
ListView1.Scrollable = False
ListView2.Scrollable = False
ListView1.Dock = DockStyle.None
ListView2.Dock = DockStyle.None
'Some test data
ListView1.Columns.Add("Data")
ListView2.Columns.Add("Data")
For i As Integer = 0 To 50
ListView1.Items.Add(i.ToString)
ListView2.Items.Add(i.ToString)
Next
End Sub
Private Sub Panel1_Scroll(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.ScrollEventArgs) Handles Panel1.Scroll
If e.ScrollOrientation = ScrollOrientation.HorizontalScroll Then
Panel2.HorizontalScroll.Value = e.NewValue
Else
Panel2.VerticalScroll.Value = e.NewValue
End If
End Sub
Private Sub Panel2_Scroll(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.ScrollEventArgs) Handles Panel2.Scroll
If e.ScrollOrientation = ScrollOrientation.HorizontalScroll Then
Panel1.HorizontalScroll.Value = e.NewValue
Else
Panel1.VerticalScroll.Value = e.NewValue
End If
End Sub
End Class