Board index » delphi » TListBox Horiz Scroll Bar (D4)

TListBox Horiz Scroll Bar (D4)

It appears that the horizontal scroll bar shows up in a listbox
anytime more than one column is specified, even if the items do
not fill up the eg two columns.  I can defeat this by bumping the
column count to 1 more than I need, but then the list is not very
attractive.  Any ideas?

Thanks.

Steve Cantrill

 

Re:TListBox Horiz Scroll Bar (D4)


Quote
"Stephen Cantrill" <cantr...@ix.netcom.com> wrote in message

news:3A2CDD22.B2BC687@ix.netcom.com...

Quote
> It appears that the horizontal scroll bar shows up in a listbox
> anytime more than one column is specified, even if the items do
> not fill up the eg two columns.  I can defeat this by bumping the
> column count to 1 more than I need, but then the list is not very
> attractive.  Any ideas?

i don't really understand your problem. maybe i'm just stupid:o) could u b
more specific?

--
Live a clean, healthy life and you will soon die of boredom.
Half of being smart is knowing what you're dumb at.
ICQ: 91418899
http://www.planeted.co.uk
http://members.nbci.com/edduffe

Re:TListBox Horiz Scroll Bar (D4)


Quote
In article <3A2CDD22.B2BC...@ix.netcom.com>, Stephen Cantrill wrote:
> It appears that the horizontal scroll bar shows up in a listbox
> anytime more than one column is specified, even if the items do
> not fill up the eg two columns.  I can defeat this by bumping the
> column count to 1 more than I need, but then the list is not very
> attractive.  Any ideas?

The technique shown in the following example can be applied to about
any windowed control with a standard scrollbar.

Hide the horizontal scrollbar on a listview

Derive a new class from TListview, like this:

type
  TNoHScrollListview = Class( TListview )
  private
    Procedure WMNCCalcSize( Var msg: TMessage );
      message WM_NCCALCSIZE;
  end;

procedure TNoHScrollListview.WMNCCalcSize(var msg: TMessage);
var
  style: Integer;
begin
  style := getWindowLong( handle, GWL_STYLE );
  If (style and WS_HSCROLL) <> 0 Then
    SetWindowLong( handle, GWL_STYLE, style and not WS_HSCROLL );
  inherited;
end;

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: Till Feb.2001 i will only visit the groups on weekends, so  be
patient if i don't reply immediately.

Other Threads