Solved

CScrollView scrollbar visible?

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Awk Need Help 3 128
fizzArray2 challenge 1 88
pre4 challenge 19 103
Fibonacci challenge 11 132
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.
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.

792 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