Solved

CScrollView scrollbar visible?

Posted on 2002-03-11
5
906 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ADO Memory leak with DELPHI 2007 37 170
Whole sheet autoscrub still needed 19 48
Expand to include initial dialog with two choices. 9 66
substring method in java 1 96
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

948 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now