Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Remove Horizontal ScrollBar from ListView ?

992 views
Skip to first unread message

Geoff

unread,
Aug 31, 2000, 2:22:42 PM8/31/00
to

Is it possible to remove the horizontal scrollbar (if added)
from a ListView. I already have the control subclassed to
trap the scrollbar clicks, but looking through the Win32 API
text, there are specific messages for some controls (i.e. ListBox)
but not ListView.

mtia

Geoff


Tom Esh

unread,
Aug 31, 2000, 4:52:09 PM8/31/00
to
The core LV control has no provision for it except LVS_NOSCROLL which
kills both, but you can hide it with ShowScrollBar. Problems with that
are 1) it does not prevent it from re-showing it on resize, etc, and
2) since it doesn't expect it to be hidden, it doesn't invalidate /
re-paint the area where the scrollbar is not. Alternatively you can
disable it with EnableScrollBar. The control doesn't try to re-enable
it plus it paints correctly. Either way you'll need to hook WM_KEYDOWN
if you need to prevent scrolling with the keyboard.

On Thu, 31 Aug 2000 19:22:42 +0100, "Geoff" <geoff....@zoom.co.uk>
wrote:

-Tom
(please post replies to the newsgroup)

alpine

unread,
Aug 31, 2000, 5:03:36 PM8/31/00
to

You should be able to do something like the following.....

Dim fStyle&

fStyle = GetWindowLong(hListview, GWL_STYLE)

If fStyle And WS_HSCROLL Then
Call SetWindowLong(hListview, GWL_STYLE, fStyle Xor WS_HSCROLL)
End If

HTH,
Bryan

_________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alp...@mvps.org Hunter S. Thompson -
MS MVP Visual Basic Fear and Loathing in LasVegas

Geoff (CADS)

unread,
Sep 1, 2000, 6:34:53 AM9/1/00
to

cheers guys
I tried both methods (and ShowScrollBar which wasn't mentioned), but in the
end
all I needed to do was to detect the addition of the scroll bar and then
reset the
ColumnHeader widths as there isn't a need to resize them above whate they
are anyway.

thanks

Geoff

alpine <alp...@mvps.org> wrote in message
news:uiX9H54EAHA.196@cppssbbsa05...

0 new messages