Solved

Removing Scroll Bars from a single Splitter Window Pane

Posted on 1997-04-22
6
458 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
  • 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

10 Experts available now in Live!

Get 1:1 Help Now