list box column widths

list box column widths

Anonymous
Not applicable
204 Views
1 Reply
Message 1 of 2

list box column widths

Anonymous
Not applicable
hi

i have a list box which lists the drawings in the current folder, and was
wondering if it is possible to automatically size the list box column widths
to the longest file name....
0 Likes
205 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Something like:

Dim FileName As String
Dim ColWidth As Integer

ColWidth = 0
For Each FileName In FileNameList
If Len(FileName) > ColWidth Then
ColWidth = Len(FileName)
End If
Next
ColWidth = ColWidth * ListBox1.Font.Size * 0.75

-- Walter -- http://www.ActiveDwg.com
0 Likes