Link to home
Start Free TrialLog in
Avatar of yoavo
yoavo

asked on

VScrollBar in a CListCtrl

Hi,
I need to know if a Vertical ScrollBar is shown in a CListCtrl. I tried to use:
CScrollBar* CWnd::GetScrollBarCtrl(int) const,
but it does not work (returns NULL, unless class derive from CView...).

thanks,
Yoav.

ASKER CERTIFIED SOLUTION
Avatar of migel
migel

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
Avatar of yoavo
yoavo

ASKER

Hi migel,
I tried using GetScrollInfo, and I am not sure I can get from the SCROLLINFO structure if a scroll bar exist or not.
The only thing I found out is that when a scroll bar does not exist then then in the SCROLLINFO struct: nPage > nMax
can I trust this ???

Yoav.
Hi!
did you include mask SIF_RANGE?
does nMin == nMax??
Avatar of yoavo

ASKER

I included SIF_ALL (which is the default):
BOOL GetScrollInfo( int nBar, LPSCROLLINFO lpScrollInfo, UINT nMask = SIF_ALL );

mMin is always 0...
nMax ?
Avatar of yoavo

ASKER

nMax depands on the height of the control.
I think if (nPage <= nMax) then the scroll appears...