Solved

VScrollBar in a CListCtrl

Posted on 2002-06-12
6
624 Views
Last Modified: 2013-11-20
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.

0
Comment
Question by:yoavo
  • 3
  • 3
6 Comments
 
LVL 12

Accepted Solution

by:
migel earned 100 total points
ID: 7074816
Hi!
this method alvays returns NULL for windows that implements scrollbar via  windows styles.
Try use GetSrcollInfo to determine is scrollbar visible
0
 

Author Comment

by:yoavo
ID: 7074901
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.
0
 
LVL 12

Expert Comment

by:migel
ID: 7074944
Hi!
did you include mask SIF_RANGE?
does nMin == nMax??
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

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

mMin is always 0...
0
 
LVL 12

Expert Comment

by:migel
ID: 7074994
nMax ?
0
 

Author Comment

by:yoavo
ID: 7075023
nMax depands on the height of the control.
I think if (nPage <= nMax) then the scroll appears...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Expand macro to include alternate header placement and naming 5 75
maxBlock challenge 30 142
no14 challenge 14 70
canBalance challenge 34 98
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question