|
|
|
date: Thu, 14 Aug 2008 02:51:02 -0700,
group: microsoft.public.win32.programmer.ui
back
Listview scrollbars
Could someone in the know elaborate on listview scrollbars, please?
I was trying to get a LVS_REPORT with a working vertical scrollbar, but
without the ugly and unnecessary horizontal one. What a pain. Took me whole
day of googling and hacking to come up with something similar to what I
wanted, but not quite the real thing...
To begin with, listviews don't seem to care about WS_H/VSCROLL window
styles. Turns out they are set by default. Disabling them via
Get/SetWindowLongPtr doesn't change a thing, either. Turns out you have to
set LVS_NOSCROLL style too, even though it is documented as being
incompatible with LVS_REPORT. The incompatibleness is that column headers are
no longer displayed. First thing that springs to mind is knowledge base
article Q137520, of course. It describes exactly the hack necessary to
properly position column headers. Fine. Now I got a listview report never
displaying a horizontal scrollbar, but always displaying a vertical
scrollbar. Alas, it is always enabled with a full-sized thumb and doesn't
react to size or item number changes. In other words, not scrollable.
My next try will be completely disabling listview scrollbars and adding my
own...
FYI, my first naive approach was to detect when a scrollbar appears and
manipulate it as required. That didn't work because GetScrollBarInfo always
returned STATE_SYSTEM_INVISIBLE for both scrollbars, invisible or not...
date: Thu, 14 Aug 2008 02:51:02 -0700
author: WhatDoIKnow
Re: Listview scrollbars
WhatDoIKnow wrote:
> Could someone in the know elaborate on listview scrollbars, please?
>
> I was trying to get a LVS_REPORT with a working vertical scrollbar, but
> without the ugly and unnecessary horizontal one. What a pain. Took me whole
> day of googling and hacking to come up with something similar to what I
> wanted, but not quite the real thing...
>
> To begin with, listviews don't seem to care about WS_H/VSCROLL window
> styles. Turns out they are set by default. Disabling them via
> Get/SetWindowLongPtr doesn't change a thing, either. Turns out you have to
> set LVS_NOSCROLL style too, even though it is documented as being
> incompatible with LVS_REPORT. The incompatibleness is that column headers are
> no longer displayed. First thing that springs to mind is knowledge base
> article Q137520, of course. It describes exactly the hack necessary to
> properly position column headers. Fine. Now I got a listview report never
> displaying a horizontal scrollbar, but always displaying a vertical
> scrollbar. Alas, it is always enabled with a full-sized thumb and doesn't
> react to size or item number changes. In other words, not scrollable.
>
> My next try will be completely disabling listview scrollbars and adding my
> own...
>
> FYI, my first naive approach was to detect when a scrollbar appears and
> manipulate it as required. That didn't work because GetScrollBarInfo always
> returned STATE_SYSTEM_INVISIBLE for both scrollbars, invisible or not...
Doesn't just not setting the column headers too wide sort it?
I only get the horizontal scrollbar when the the total column width
exceeds the listview width.
--
Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team
iCode Systems
date: Thu, 14 Aug 2008 11:38:33 +0100
author: Dean Earley
|
|