Solved

Removing Scroll Bars from a single Splitter Window Pane

Posted on 1997-04-22
6
461 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Awk Need Help 3 118
building a service to accessed via telnet client, want colors ? 4 88
Problem to event 3 96
Is there a simple front-end menu system. 9 89
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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.

777 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