Re: Horizontal Scrollbar For Lisbox

From: Justin Starnes (captainstarnes_at_hotmail.com)
Date: 10/20/04


Date: Tue, 19 Oct 2004 20:53:52 -0400

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" <rjNOrhSPAM@PLEASEnetvigator.com> wrote in message
news:OUtzfqjtEHA.4040@TK2MSFTNGP09.phx.gbl...
> 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" <captainstarnes@hotmail.com> wrote in message
> news:OqAnWhjtEHA.376@TK2MSFTNGP09.phx.gbl...
>>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
>>
>
>



Relevant Pages

  • Re: Horizontal Scrollbar For Lisbox
    ... determine the width of the longest string. ... using the GetTextExtent32 function to obtain the length of the string. ... > Just set the columnwidth to more than the width of the listbox in the ... >>the listbox but am having trouble finding a code sample for userforms. ...
    (microsoft.public.excel.programming)
  • Needless Horizontal scrollbar in Listbox
    ... What determines the presence of a Horizontal scrollbar on a Listbox? ... think it would be dependent on the width of the longest string you put in. ...
    (microsoft.public.excel.programming)
  • Horizontal Scrollbar For Lisbox
    ... I have a listbox on a userform that contains entries longer than the length ... I'm looking to add a horizontal scrollbar to the ... listbox but am having trouble finding a code sample for userforms. ...
    (microsoft.public.office.developer.vba)
  • Horizontal Scrollbar For Lisbox
    ... I have a listbox on a userform that contains entries longer than the length ... I'm looking to add a horizontal scrollbar to the ... listbox but am having trouble finding a code sample for userforms. ...
    (microsoft.public.excel.programming)
  • Re: Horizontal Scrollbar For Lisbox
    ... Just set the columnwidth to more than the width of the listbox in the ... properties pane in the VBE. ... Robin Hammond ... >listbox but am having trouble finding a code sample for userforms. ...
    (microsoft.public.office.developer.vba)