Solved

CScrollView scrollbar visible?

Posted on 2002-03-11
5
913 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand LInux Boot partition remotly 3 102
Host to IP 7 83
while loop over for loop 7 116
how to use laptop or pad camera in vb.net windows application 2 103
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…

763 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