Re: Scrollbars and CListCtrl

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You said it has only one column. Just make sure the width of this column is <= the width
of the client area of the control. If GetClientRect is returning the wrong width, you
could subtract off ::GetSystemMetrics(SM_CXVTHUMB) [if I remember the name correctly,
check GetSystemMetrics) which is the width of the vertical scrollbar thumb.
joe

On Fri, 11 May 2007 08:07:10 GMT, Henryk Birecki <soaringpilot@xxxxxxxxxxxxx> wrote:

I am working with CListCtrl window which has only one column, but I
really need to suppress appearance of horizontal scroll bar. I tried
to modify window style to remove WS_HSCROLL, but seems that MFC
overrides me. For now I am suppressing it by loading data, getting
client rectangle and setting column width to client rectangle width.
Unfortunately this fails with PocketPC WinMobile 5. There
GetClientRect seems to return rectangle that includes scrollbar. This
adds a problem of now finding the width of vertical scrollbar,
solution to which is not obvious to me.

There must be a better way to suppress horizontal scrollbar in
CListCtrl. Can someone please point me at it, or at least tell me how
to programatically find scroll bar width in CListCtrl.

Thanks,
Henryk Birecki
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: ScrollBar
    ... I thought I could get rid of the ScrollBar simply by setting the height ... Try Adjusting the ClientWidth and ClientHeigth of the DBgrid ... Normally the scrollbars are set to automatic if the client ...
    (comp.lang.pascal.delphi.misc)
  • Re: Scrollbar problem
    ... And the child frame is initialized so that the client view has a size ... But in my test, the scrollbar turns out to be still enabled, with the ... Microsoft MVP - Windows SDK ...
    (microsoft.public.win32.programmer.ui)
  • CListCtrl Scroll Issue
    ... width doesn't fit the client area. ... Now I changed the Client Size in OnNcCalcSize function using the ... It's because we reduced the client area a vertical scrollbar width. ...
    (microsoft.public.vc.mfc)
  • Re: Centering divs in firefox and scrollbar issue
    ... >> right 24 pixels of your page invisible, ... The behaviour of IE is that the scrollbar is always ... > As usual the client wants a fixed width "table style" in the center of the page. ... Sonhos vem. ...
    (comp.infosystems.www.authoring.stylesheets)