View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.office.developer.vba
Paul Robinson Paul Robinson is offline
external usenet poster
 
Posts: 208
Default Horizontal Scrollbar For Lisbox

Hi Justin
Robin's suggestion has nothing to do with the length of the string
(you've found yourself a fine red herring there), but properties of
the Listbox. Try it!
Paul

"Justin Starnes" wrote in message ...
Unfortunately, the problem with that solution is that I cannot accurately
determine the width of the longest string. To solve that problem, I tried
using the GetTextExtent32 function to obtain the length of the string.
Hoewver, when I set columnwidths to that value, I don't get the correct
result. ColumnWidths defaults to points for the specification. Is
GetTextExtent returning twips, pixels, etc.? I tried to convert it to
points, but am not having much luck. Any ideas?



"Robin Hammond" wrote in message
...
Just set the columnwidth to more than the width of the listbox in the
properties pane in the VBE.

Robin Hammond
www.enhanceddatasystems.com

"Justin Starnes" wrote in message
...
I have a listbox on a userform that contains entries longer than the
length of the listbox. Thus, I'm looking to add a horizontal scrollbar to
the listbox but am having trouble finding a code sample for userforms.
Does anyone have an example or can help me get one working with userforms?

Thanks,
Justin