-
Is anyone could show me how to keep the recently added item in ListBox highlighted (selected) so that it is shown on screen?
By simply using the AddNew method to add items to ListBox, the ListBox always shows the few items at top (starting from item0,1 and so on). After filling the total height of ListBox, the newly added item could not be seen on screen. Is any way to keep the ListBox Updated and shows the most recent items? Thanks in advance.
-
Use the TopIndex Property of the Listbox, ie.
Code:
Private Sub Command1_Click()
Dim iIndex As Integer
For iIndex = 0 To 10000
List1.AddItem "Item " & iIndex
List1.TopIndex = iIndex
Next
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Thank you Aaron for your help, I tried your tip and it works very well.
WG