Solved

CScrollView scrollbar visible?

Posted on 2002-03-11
5
911 Views
Last Modified: 2013-11-20
I'm using a CScrollView and would like to know if the horizontal and vertical scrollbars are currently visible. Anyone know how to do this?
0
Comment
Question by:zeekial
5 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6855751
Hmm, you could try

DWORD dwStyle = GetWindowLong ( pScrollView->m_hWnd, GWL_STYLE);

if ( dwStyle | WS_HSCROLL) {

 // has horiz. bar
}

if ( dwStyle | WS_VSCROLL) {

 // has vert. bar
}
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 6855803
SCROLLINFO info;
info.cbSize = sizeof(SCROLLINFO);
info.fMask = SIF_TRACKPOS;

if ( ::GetScrollInfo(m_hWnd, SB_HORZ, &info) )
{
     // scrollbar there
}
else
{
     // no scrollbar available
}

GOOD LUCK
0
 

Author Comment

by:zeekial
ID: 6856851
roshmon and jkr,

Here's more specifics on what I'm trying to do. I'm diplaying a bitmap image(CScrollView) in an MDI child window. I would like to constrain the user from sizing the CMDIChildWnd beyond the edge of the displayed bitmap. To do this I'm using the OnGetMinMaxInfo handler in the CMDIChildWnd.  The problem is when the scrollbars are displayed the constrained size must be increased otherwise the scroll bars will obscure the edges of the view. I've tried both of the previous comments and style is always reported as true even if the bars are not displayed.

Regards,
zeekial
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 10371478
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
PAQ refund points
Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

AndyAinscow
EE Cleanup Volunteer
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10417530
PAQed, with points refunded (300)

modulo
Community Support Moderator
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

778 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