Article ID: 103809
Article Last Modified on 10/30/2003
DefInt A-Z
Sub Form_Load ()
'Initialize two list boxes with the alphabet
For i = 1 To 26
list1.AddItem Chr$(i + 64)
Next i
For i = 1 To 26
list2.AddItem Chr$(i + 64)
Next i
Timer1.Interval = 1
Timer1.Enabled = True
End Sub
Sub Command1_Click ()
End
End Sub
Sub Timer1_Timer ()
Static PrevTI_List1
'Get the index for the first item in the visible list
TopIndex_List1 = list1.TopIndex
'See if the top index has changed
If TopIndex_List1 <> PrevTI_List1 Then
'Set the top index of List2 equal to List1 so that the list boxes
'scroll to the same relative position
list2.TopIndex = TopIndex_List1
'Keep track of the current top index
PrevTI_List1 = TopIndex_List1
End If
'Select the item in the same relative position in both list boxes
If list1.ListIndex <> list2.ListIndex Then
list2.ListIndex = list1.ListIndex
End If
End Sub
Additional query words: 2.00 3.00
Keywords: KB103809