Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
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

Re: Listview scrollbars   
"Dean Earley" wrote:

> 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.

Yes, of course it does. A workmate here just pointed out the same. Even more 
so, as I already distribute column widths. Just had to subtract 
::GetSystemMetrics(SM_CXVSCROLL) from the total width... Oh well, guess I 
couldn't see the forest because of all those trees. =o/ Thanks Dean! 

Still, there's something inherently wrong with listview scrollbars. This is 
just a nice & easy way around that weirdness.
date: Thu, 14 Aug 2008 05:33:01 -0700   author:   WhatDoIKnow

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us