PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Joseph Caverly on November 28, 2010, 06:15:45 PM

Title: Horizontal Scrollbar For ListBox
Post by: Joseph Caverly on November 28, 2010, 06:15:45 PM
Hi,
  Using FireFly Version 3.10, and PowerBASIC Classic.

  I cannot seem to get a horizontal scrollbar to appear in a ListBox.

  I have checked the WS_HSCROLL Style in the Listbox Properties.

  I load the ListBox thus;

Sub File2ListBox
  Local MaxLength As Long
     
  MaxLength = 0
 
  FF_ListBox_ResetContent( HWND_FRMLOADLISTBOX_LIST1 )
 
  Open "C:\WINNT\system32\drivers\etc\hosts" For Input As #1
 
  Do While Not Eof(1)
    Line Input #1, RecordIn$
    If Len(RecordIn$) > MaxLength Then MaxLength = Len(RecordIn$)
    FF_ListBox_AddString( HWND_FRMLOADLISTBOX_LIST1, RecordIn$ )
  Loop
  Close #1
  MsgBox("Maximum Length Is " + Str$(MaxLength))
End Sub

The entire file is loaded into the listbox, and the Maximum Length Returned Is 96, but no horizontal scrollbar, so I am unable to read the longer lines.

Is there another setting required to enable the horizontal scrollbar in a ListBox?

Thanks from Joe
Title: Re: Horizontal Scrollbar For ListBox
Post by: Paul Squires on November 28, 2010, 07:07:58 PM
Hi Joe,

You can try sending the ListBox the %LB_SETHORIZONTALEXTENT message.

350 is the width in pixels... you can change that to whatever value you wish. You need to specify the WS_HSCROLL style for the ListBox.


  SendMessage HWND_FRMLOADLISTBOX_LIST1, %LB_SETHORIZONTALEXTENT, 350, 0