Solved

Removing Scroll Bars from a single Splitter Window Pane

Posted on 1997-04-22
6
472 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 50 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
Independent Software Vendors: 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 106
zeroFront challenge 7 124
fix34  challenge 9 166
Line meaning 9 91
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 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