>I need to load a list box in a SCAN/ENDSCAN.
>
>Some columns may or may not be visible, so I want to set the ColumnWidths property
>from the data.
>
>How do I calculate the ListBox ColumnWidth? I could use FONTMETRIC(6,,) * FSIZE(), but that
>would result in some really wide columns in the listbox.
You could calculate max(txtwidth(alltrim(yourfield), listbox.fontname, listbox.fontsize, "N"), that would give you a pretty good estimate. Add a few pixels for margin.