Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Removing Scroll Bars from a single Splitter Window Pane

Posted on 1997-04-22
6
Medium Priority
?
490 Views
Last Modified: 2013-11-20
How do you remove scroll bars from a single pane of a splitter window?  I have a MDI application set up with one of the child windows as a splitter window.  There are four panes in my splitter window and I want to remove the vertical and horizontal scroll bars from one pane and not the rest.  Also the view I want to remove the scroll bars from is a  CFormView that has a grid control on it with my own set of scroll bars.  Thus, I have a redundant set of scroll bars, but I want to keep my own and not the window frame's scroll bars.  The MDI child windows are also maximized at all times and have the WS_SYMENU feature removed.

Thanks for your help.
0
Comment
Question by:David Gray
[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
  • 4
  • 2
6 Comments
 

Author Comment

by:David Gray
ID: 1301147
Edited text of question
0
 
LVL 1

Accepted Solution

by:
rhgaracci earned 100 total points
ID: 1301148
CFormView is derived from CScrollView, so scrolling is built in to CFormView by inheritance.  I am assuming that you are using static splitters so that your CFormView pane can not be resized.

One way to solve your problem is to always set the scroll size to the window size.  Use ClassWizard to create the OnSize method in response to the WM_SIZE message.  Add the following line of code:

   SetScrollSizes(MM_TEXT, CSize(cx, cy));

If you will never resize, just put this line in OnInitDialog in response to WM_INITDIALOG:

   CRect clientRect;
   GetClientRect(clientRect);
   SetScrollSizes(MM_TEXT, clientRect.Size());

This should do the trick.



0
 
LVL 1

Expert Comment

by:rhgaracci
ID: 1301149
Here is an even better way.

In OnSize() add the line

   EnableScrollBarCtrl(SB_BOTH,FALSE);

instead of what I recommended before.
0
Industry Leaders: 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!

 
LVL 1

Expert Comment

by:rhgaracci
ID: 1301150
Best yet, in the OnSize() method, bypass the CFormView::Onsize(...) and call the CView::OnSize() method.  This works just fine and is the most efficient.  Sorry this answer has been incremental.
0
 

Author Comment

by:David Gray
ID: 1301151
Your first two solutions didn't seem to work, but the third solution solved my problem.  Thanks for the tip.
0
 
LVL 1

Expert Comment

by:rhgaracci
ID: 1301152
Glad to be of service.  I used the ViewEx MFC sample to experiment with in seeking the solution.  I also looked in the MFC source code for CFormView and CScrollView to figure out how they handled scrolling.
0

Featured Post

Industry Leaders: 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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

604 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