Hi Kevin,
Here is a little extra info for you. You can actually make the scrollbar go exactly to the length of the longest item in the listbox. I achieve it by having a Textbox with the Visible property set to false and the Autosize property set to true and with the same font settings as the listbox. I get the value of the first item in the listbox and set the textbox with this value then set the columnwidth of the listbox to the width of the textbox. I then loop all items in the listbox setting the value of the textbox and if the textbox width is greater than the listbox's columnwidth I update it. Here is my code for a listbox called lstBatch and textbox called txtListScroll that I run after the listbox gets updated.
Regards - Nathan
Code:
Private Sub SetScroll()
Dim intListCount As Integer
Dim intCount As Integer
intListCount = lstBatch.ListCount
If intListCount <> 0 Then
txtListScroll = lstBatch.list(0)
lstBatch.ColumnWidths = txtListScroll.Width
End If
intCount = 0
While intCount <> intListCount
txtListScroll = lstBatch.list(intCount)
If lstBatch.ColumnWidths < txtListScroll.Width & " pt" Then
lstBatch.ColumnWidths = txtListScroll.Width
End If
intCount = intCount + 1
Wend
End Sub