Solved

Removing Scroll Bars from a single Splitter Window Pane

Posted on 1997-04-22
6
466 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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
Pressing cancel button with C# UI Automation 3 81
Complete beginner needs help making a cron job 9 125
fizzArray2 challenge 1 91
modThree challenge 4 98
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

828 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