VB Code:
Dim lngWidth As Long Dim lngLongest As Long Dim lngIndex As Long lngWidth = List1.Width 'see what the longest entry is For lngIndex = 0 To List1.ListCount - 1 If Len(List1.List(lngIndex)) > Len(List1.List(lngLongest)) Then lngLongest = lngIndex List1.Width = Me.TextWidth(List1.List(lngIndex) + Space$(5)) End If Next lngIndex Frame1.Width = Frame1.Width + (List1.Width - lngWidth)




Reply With Quote