VB Code:
  1. Dim lngWidth As Long
  2.     Dim lngLongest As Long
  3.     Dim lngIndex As Long
  4.    
  5.     lngWidth = List1.Width
  6.     'see what the longest entry is
  7.     For lngIndex = 0 To List1.ListCount - 1
  8.         If Len(List1.List(lngIndex)) > Len(List1.List(lngLongest)) Then
  9.             lngLongest = lngIndex
  10.             List1.Width = Me.TextWidth(List1.List(lngIndex) + Space$(5))
  11.         End If
  12.     Next lngIndex
  13.     Frame1.Width = Frame1.Width + (List1.Width - lngWidth)