Private Const LB_GETTOPINDEX = &H18E
Private Const LB_SETTOPINDEX = &H197
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub Form_Load()
For i = 1 To 50
List1.AddItem "artikel " & CStr(i)
List2.AddItem "artikel " & CStr(i)
Next
End Sub
Private Sub List1_Scroll()
Call SendMessage(List2.hwnd, LB_SETTOPINDEX, SendMessage(List1.hwnd, LB_GETTOPINDEX, 0, 0), 0)
End Sub
Private Sub List2_Scroll()
Call SendMessage(List1.hwnd, LB_SETTOPINDEX, SendMessage(List2.hwnd, LB_GETTOPINDEX, 0, 0), 0)
End Sub
Private Sub List2_Click()
List1.ListIndex = List2.ListIndex
End Sub
Private Sub List1_Click()
List2.ListIndex = List1.ListIndex
End Sub