Link to home
Start Free TrialLog in
Avatar of bengore
bengore

asked on

Hide horizontal scrollbar in a TListView

How to hide the (optional)horizontal scrollbar in a TListView?
Avatar of Cesario Lababidi
Cesario Lababidi
Flag of Germany image

Hi bengore,

AFAIK, you can hide both scrollbar.

Derive a new control from TTreeview and override its CreateParams method like this:

procedure tNoScrollbarsTreeview.createparams(var params: TCreateParams);
begin
  inherited;
  params.style := params.style or TVS_NOSCROLL;
end;

Best Regards

Cesario
Avatar of bengore
bengore

ASKER

I don't want to make a new component. Is there no possibility to make the changes in the FormCreate procedure like:
SetWindowsStyle(Listbox.Handle, TVS_NOSCROLL) or some other Windows API function?
Hi bengore,

no its not possible. The Listview manage the Scrollbars and will show them automaticly.

I hope some other Experts here can help you.

Best Regards

Cesario
try this:

ShowScrollBar(MyListView.Handle, SB_HORZ, False);
Hi TOndrej,

it works but if you scroll down the Scrollbar appears again. ( that is window :-) )

Cesario
ASKER CERTIFIED SOLUTION
Avatar of TOndrej
TOndrej

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Cool solution :_)))

Cesario